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>]')
|
.command('unpublish [<extensionid>]')
|
||||||
.description('Unpublishes an extension. Example extension id: microsoft.csharp.')
|
.description('Unpublishes an extension. Example extension id: microsoft.csharp.')
|
||||||
.option('-p, --pat <token>', 'Personal Access Token')
|
.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
|
program
|
||||||
.command('ls-publishers')
|
.command('ls-publishers')
|
||||||
|
|
|
@ -92,6 +92,7 @@ export interface IPublishOptions {
|
||||||
commitMessage?: string;
|
commitMessage?: string;
|
||||||
cwd?: string;
|
cwd?: string;
|
||||||
pat?: string;
|
pat?: string;
|
||||||
|
force?: boolean;
|
||||||
baseContentUrl?: string;
|
baseContentUrl?: string;
|
||||||
baseImagesUrl?: string;
|
baseImagesUrl?: string;
|
||||||
useYarn?: boolean;
|
useYarn?: boolean;
|
||||||
|
@ -187,14 +188,19 @@ export function unpublish(options: IUnpublishOptions = {}): Promise<any> {
|
||||||
}
|
}
|
||||||
|
|
||||||
return promise.then(({ publisher, name }) => {
|
return promise.then(({ publisher, name }) => {
|
||||||
|
|
||||||
const fullName = `${publisher}.${name}`;
|
const fullName = `${publisher}.${name}`;
|
||||||
const pat = options.pat
|
const pat = options.pat
|
||||||
? Promise.resolve(options.pat)
|
? Promise.resolve(options.pat)
|
||||||
: getPublisher(publisher).then(p => p.pat);
|
: getPublisher(publisher).then(p => p.pat);
|
||||||
|
|
||||||
return read(`This will FOREVER delete '${fullName}'! Are you sure? [y/N] `)
|
const force = options.force;
|
||||||
.then(answer => /^y$/i.test(answer) ? null : Promise.reject('Aborted'))
|
|
||||||
.then(() => pat)
|
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(getGalleryAPI)
|
||||||
.then(api => api.deleteExtension(publisher, name))
|
.then(api => api.deleteExtension(publisher, name))
|
||||||
.then(() => log.done(`Deleted extension: ${fullName}!`));
|
.then(() => log.done(`Deleted extension: ${fullName}!`));
|
||||||
|
|
Loading…
Add table
Reference in a new issue