Skip to content

useYarn parameter while publishing extension #268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 [<extensionid>]')
Expand Down
4 changes: 3 additions & 1 deletion src/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export interface IPublishOptions {
pat?: string;
baseContentUrl?: string;
baseImagesUrl?: string;
useYarn?: boolean;
}

function versionBump(cwd: string = process.cwd(), version?: string): Promise<void> {
Expand Down Expand Up @@ -139,10 +140,11 @@ export function publish(options: IPublishOptions = {}): Promise<any> {
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 }) => {
Expand Down