From 5726bf5bad158e0870d59216fce2375d048443b7 Mon Sep 17 00:00:00 2001 From: martin bendsoe Date: Tue, 21 Jul 2020 11:09:15 +0200 Subject: [PATCH] fixed gulp set issue --- gulpfile.babel.js | 7 +++++-- package.json | 2 +- src/version.js | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 8b380e74c..015a66a46 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -140,8 +140,11 @@ gulp.task( /** Set the project version, controls package.json and version.js */ gulp.task('set', function () { - // Get the --version arg from command line - const version = minimist(process.argv.slice(2), { string: 'version' }).version + // example: gulp set --x 1.7.7 + + // Get the --x arg from command line + const command = minimist(process.argv.slice(2), { string: 'x' }) + const version = command.x if (!semver.valid(version)) { throw new Error(`Invalid version "${version}"`) diff --git a/package.json b/package.json index 3e7151095..650153f64 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "run-stress-tests": "gulp run-stress-tests", "run-ts-declaration-tests": "gulp run-ts-declaration-tests", "docs": "esdoc -c esdoc.json", - "versionRelease": "gulp set --version $VERSION && npm version $VERSION --no-git-tag-version", + "versionRelease": "gulp set --x $VERSION && npm version $VERSION --no-git-tag-version", "browser": "gulp browser && gulp test-browser" }, "husky": { diff --git a/src/version.js b/src/version.js index c16371d61..ed6f2bd58 100644 --- a/src/version.js +++ b/src/version.js @@ -19,7 +19,8 @@ // DO NOT CHANGE THE VERSION BELOW HERE // This is set by the build system at release time, using -// gulp set --version +// +// gulp set --x // // This is set up this way to keep the version in the code in // sync with the npm package version, and to allow the build