Skip to content

fixed gulp set issue #601

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
Jul 21, 2020
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
7 changes: 5 additions & 2 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}"`)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
3 changes: 2 additions & 1 deletion src/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <releaseversion>
//
// gulp set --x <releaseversion>
//
// 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
Expand Down