Merge commit 'refs/pull/405/head' of github.com:microsoft/vscode-vsce into pr/405
This commit is contained in:
commit
aa73aacb0e
2 changed files with 11 additions and 4 deletions
|
@ -93,7 +93,8 @@ module.exports = function (argv: string[]): void {
|
|||
.command('unpublish [<extensionid>]')
|
||||
.description('Unpublishes an extension. Example extension id: microsoft.csharp.')
|
||||
.option('-p, --pat <token>', 'Personal Access Token')
|
||||
.action((id, { pat }) => main(unpublish({ id, pat })));
|
||||
.option('-f, --force', 'Forces Unpublished Extension')
|
||||
.action((id, { pat, force }) => main(unpublish({ id, pat, force })));
|
||||
|
||||
program
|
||||
.command('ls-publishers')
|
||||
|
|
|
@ -92,6 +92,7 @@ export interface IPublishOptions {
|
|||
commitMessage?: string;
|
||||
cwd?: string;
|
||||
pat?: string;
|
||||
force?: boolean;
|
||||
baseContentUrl?: string;
|
||||
baseImagesUrl?: string;
|
||||
useYarn?: boolean;
|
||||
|
@ -187,14 +188,19 @@ export function unpublish(options: IUnpublishOptions = {}): Promise<any> {
|
|||
}
|
||||
|
||||
return promise.then(({ publisher, name }) => {
|
||||
|
||||
const fullName = `${publisher}.${name}`;
|
||||
const pat = options.pat
|
||||
? Promise.resolve(options.pat)
|
||||
: getPublisher(publisher).then(p => p.pat);
|
||||
|
||||
return read(`This will FOREVER delete '${fullName}'! Are you sure? [y/N] `)
|
||||
.then(answer => /^y$/i.test(answer) ? null : Promise.reject('Aborted'))
|
||||
.then(() => pat)
|
||||
const force = options.force;
|
||||
|
||||
return (!force ? (
|
||||
read(`This will FOREVER delete '${fullName}'! Are you sure? [y/N] `)
|
||||
.then(answer => /^y$/i.test(answer) ? pat : Promise.reject('Aborted'))
|
||||
//.then(() => pat)
|
||||
) : pat)
|
||||
.then(getGalleryAPI)
|
||||
.then(api => api.deleteExtension(publisher, name))
|
||||
.then(() => log.done(`Deleted extension: ${fullName}!`));
|
||||
|
|
Loading…
Add table
Reference in a new issue