diff --git a/src/main.ts b/src/main.ts index bd0fcf5..8c36945 100644 --- a/src/main.ts +++ b/src/main.ts @@ -77,7 +77,8 @@ module.exports = function (argv: string[]): void { .option('--packagePath [path]', 'Publish the VSIX package located at the specified path.') .option('--baseContentUrl [url]', 'Prepend all relative links in README.md with this url.') .option('--baseImagesUrl [url]', 'Prepend all relative image links in README.md with this url.') - .action((version, { pat, packagePath, baseContentUrl, baseImagesUrl }) => main(publish({ pat, version, packagePath, baseContentUrl, baseImagesUrl }))); + .option('--yarn', 'Use yarn instead of npm while packing extension files') + .action((version, { pat, packagePath, baseContentUrl, baseImagesUrl, yarn }) => main(publish({ pat, version, packagePath, baseContentUrl, baseImagesUrl, useYarn: yarn }))); program .command('unpublish []') diff --git a/src/publish.ts b/src/publish.ts index d4c4d86..40fa09b 100644 --- a/src/publish.ts +++ b/src/publish.ts @@ -93,6 +93,7 @@ export interface IPublishOptions { pat?: string; baseContentUrl?: string; baseImagesUrl?: string; + useYarn?: boolean; } function versionBump(cwd: string = process.cwd(), version?: string): Promise { @@ -139,10 +140,11 @@ export function publish(options: IPublishOptions = {}): Promise { const cwd = options.cwd; const baseContentUrl = options.baseContentUrl; const baseImagesUrl = options.baseImagesUrl; + const useYarn = options.useYarn; promise = versionBump(options.cwd, options.version) .then(() => tmpName()) - .then(packagePath => pack({ packagePath, cwd, baseContentUrl, baseImagesUrl })); + .then(packagePath => pack({ packagePath, cwd, baseContentUrl, baseImagesUrl, useYarn })); } return promise.then(({ manifest, packagePath }) => {