Skip to content

Commit 315d443

Browse files
committed
Updating versions through gulp instead of npm
1 parent 18fdd1b commit 315d443

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

gulpfile.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,10 @@ gulp.task('watch', function watch() {
9393
gulp.watch(paths.sass.landing, ['bundle-sass-landing']);
9494
});
9595

96-
gulp.task('version', function version() {
97-
var tocVersion = require('./package.json').version;
96+
gulp.task('version', ['version-npm', 'version-config']);
97+
98+
gulp.task('version-config', function versionConfig() {
99+
var tocVersion = argv.v || argv.version;
98100
return gulp.src(basePaths.root + 'config.xml')
99101
.pipe(replace(
100102
/<widget id="net\.lewisl\.toc-im" version="[0-9]+(\.[0-9]+)*"/,
@@ -103,6 +105,16 @@ gulp.task('version', function version() {
103105
.pipe(gulp.dest(basePaths.root));
104106
});
105107

108+
gulp.task('version-npm', function versionNpm() {
109+
var tocVersion = argv.v || argv.version;
110+
return gulp.src(basePaths.root + 'package.json')
111+
.pipe(replace(
112+
/"version": "[0-9]+(\.[0-9]+)*"/,
113+
'"version": "' + tocVersion + '"'
114+
))
115+
.pipe(gulp.dest(basePaths.root));
116+
});
117+
106118
gulp.task('serve', function serve() {
107119
var serveCommand = argv.prod ?
108120
'http-server www -p 8100' :

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
"type": "git",
88
"url": "[email protected]:lewisl9029/toc.git"
99
},
10-
"scripts": {
11-
"version": "gulp version && git add -A ."
12-
},
1310
"dependencies": {},
1411
"devDependencies": {
1512
"gulp": "^3.9.0",

0 commit comments

Comments
 (0)