add --ignoreFile option to publish command

This commit is contained in:
Alessandro Fragnani 2018-10-01 21:18:45 -03:00
parent 778b942b38
commit 5477a63e02
2 changed files with 7 additions and 4 deletions

View file

@ -72,8 +72,8 @@ module.exports = function (argv: string[]): void {
.option('--yarn', 'Use yarn instead of npm')
.option('--ignoreFile [path]', 'Indicate alternative .vscodeignore')
.action(({ out, baseContentUrl, baseImagesUrl, yarn, ignoreFile }) => main(packageCommand({ packagePath: out, baseContentUrl, baseImagesUrl, useYarn: yarn, ignoreFile })));
program
program
.command('publish [<version>]')
.description('Publishes an extension')
.option('-p, --pat <token>', 'Personal Access Token')
@ -81,7 +81,8 @@ module.exports = function (argv: string[]): void {
.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.')
.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 })));
.option('--ignoreFile [path]', 'Indicate alternative .vscodeignore')
.action((version, { pat, packagePath, baseContentUrl, baseImagesUrl, yarn, ignoreFile }) => main(publish({ pat, version, packagePath, baseContentUrl, baseImagesUrl, useYarn: yarn, ignoreFile })));
program
.command('unpublish [<extensionid>]')

View file

@ -95,6 +95,7 @@ export interface IPublishOptions {
baseContentUrl?: string;
baseImagesUrl?: string;
useYarn?: boolean;
ignoreFile?: string;
}
function versionBump(cwd: string = process.cwd(), version?: string): Promise<void> {
@ -142,10 +143,11 @@ export function publish(options: IPublishOptions = {}): Promise<any> {
const baseContentUrl = options.baseContentUrl;
const baseImagesUrl = options.baseImagesUrl;
const useYarn = options.useYarn;
const ignoreFile = options.ignoreFile;
promise = versionBump(options.cwd, options.version)
.then(() => tmpName())
.then(packagePath => pack({ packagePath, cwd, baseContentUrl, baseImagesUrl, useYarn }));
.then(packagePath => pack({ packagePath, cwd, baseContentUrl, baseImagesUrl, useYarn, ignoreFile }));
}
return promise.then(({ manifest, packagePath }) => {