Skip to content

Commit 93145be

Browse files
committed
Change --version parameter name to --tag as it was colliding with Gulp 4 arguments.
1 parent f1190a2 commit 93145be

File tree

2 files changed

+12
-28
lines changed

2 files changed

+12
-28
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ require('gulp-release-flows')({
3030
branch: 'master',
3131
bump: 'patch',
3232
message: 'Release %VERSION%',
33-
version: null // If null or not specified, will be retrieved from './package.json'
33+
tag: null // The new version number. If null or not specified, will be retrieved from './package.json'.
3434
});
3535
```
3636

@@ -52,4 +52,4 @@ Or
5252

5353
You can also bump to a specific release version using the following command:
5454

55-
`gulp build:release --version 0.1.0-beta.3`
55+
`gulp build:release --tag 0.1.0-beta.3`

tasks/release.js

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = function(config) {
1+
module.exports = function (config) {
22
var gulp = require('gulp');
33
var runSequence = require('run-sequence');
44
var conventionalChangelog = require('gulp-conventional-changelog');
@@ -9,7 +9,7 @@ module.exports = function(config) {
99
var minimist = require('minimist');
1010

1111
config = config || {};
12-
12+
1313
var defaultOptions = {
1414
string: 'env',
1515
default: {
@@ -18,7 +18,7 @@ module.exports = function(config) {
1818
branch: config.branch || 'master',
1919
bump: config.bump || 'patch',
2020
message: config.message || 'Release %VERSION%',
21-
version: config.version
21+
tag: config.tag
2222
}
2323
};
2424

@@ -32,37 +32,21 @@ module.exports = function(config) {
3232
return gulp.src('CHANGELOG.md', {
3333
buffer: false
3434
})
35-
.pipe(conventionalChangelog({
36-
preset: 'eslint'
37-
}))
38-
.pipe(gulp.dest('./'));
35+
.pipe(conventionalChangelog({
36+
preset: 'eslint'
37+
}))
38+
.pipe(gulp.dest('./'));
3939
});
4040

4141
/**
4242
* A task to bump package.json version
4343
**/
4444
gulp.task('build:bump-version', function () {
4545
return gulp.src(options.sources)
46-
.pipe(bump(options.version ? {version: options.version} : {type: options.bump}).on('error', gutil.log))
46+
.pipe(bump(options.tag ? {version: options.tag} : {type: options.bump}).on('error', gutil.log))
4747
.pipe(gulp.dest('./'));
4848
});
4949

50-
/**
51-
* A task to set package.json version
52-
**/
53-
gulp.task('build:set-version', function(cb) {
54-
if (!options.version) {
55-
return cb('No version argument!');
56-
}
57-
58-
// FIXME: this does nothing!
59-
var verKey = options.version_key || 'version';
60-
var regex = opts.regex || new RegExp(
61-
'([\'|\"]?' + verKey + '[\'|\"]?[ ]*:[ ]*[\'|\"]?)(\\d+\\.\\d+\\.\\d+(-' +
62-
options.version_preid +
63-
'\\.\\d+)?(-\\d+)?)[\\d||A-a|.|-]*([\'|\"]?)', 'i');
64-
});
65-
6650
/**
6751
* A task to commit all changes in current workspace.
6852
**/
@@ -83,7 +67,7 @@ module.exports = function(config) {
8367
* Create a tag for the current version where version is taken from the package.json file
8468
**/
8569
gulp.task('build:create-new-tag', function (cb) {
86-
var version = options.version || getPackageJsonVersion();
70+
var version = options.tag || getPackageJsonVersion();
8771
git.tag(version, options.message.replace('%VERSION%', getPackageJsonVersion()), function (error) {
8872
if (error) {
8973
return cb(error);
@@ -109,7 +93,7 @@ module.exports = function(config) {
10993
});
11094
});
11195

112-
function getPackageJsonVersion () {
96+
function getPackageJsonVersion() {
11397
// We parse the json file instead of using require because require caches
11498
// multiple calls so the version number won't be updated
11599
return JSON.parse(fs.readFileSync('./package.json', 'utf8')).version;

0 commit comments

Comments
 (0)