fix failing to build without .git directory
This commit is contained in:
parent
61e24f19e2
commit
8b0974cd6f
|
@ -4,6 +4,7 @@ var browserSync = require('browser-sync');
|
||||||
var del = require('del');
|
var del = require('del');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var git = require('git-rev-sync');
|
var git = require('git-rev-sync');
|
||||||
|
var tryFn = require('nice-try');
|
||||||
|
|
||||||
var $ = gulpLoadPlugins();
|
var $ = gulpLoadPlugins();
|
||||||
var reload = browserSync.reload;
|
var reload = browserSync.reload;
|
||||||
|
@ -56,7 +57,7 @@ gulp.task('prepare-scripts', function () {
|
||||||
'src/scripts/**/*.js'
|
'src/scripts/**/*.js'
|
||||||
]).pipe($.plumber())
|
]).pipe($.plumber())
|
||||||
.pipe($.injectVersion({replace: '${ARIANG_VERSION}'}))
|
.pipe($.injectVersion({replace: '${ARIANG_VERSION}'}))
|
||||||
.pipe($.replace(/\${ARIANG_BUILD_COMMIT}/g, git.short()))
|
.pipe($.replace(/\${ARIANG_BUILD_COMMIT}/g, tryFn(git.short) || 'Local'))
|
||||||
.pipe(gulp.dest('.tmp/scripts'))
|
.pipe(gulp.dest('.tmp/scripts'))
|
||||||
.pipe(reload({stream: true}));
|
.pipe(reload({stream: true}));
|
||||||
});
|
});
|
||||||
|
|
6
package-lock.json
generated
6
package-lock.json
generated
|
@ -7652,6 +7652,12 @@
|
||||||
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=",
|
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"nice-try": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-/o4KoXbUkEjD2NDwvBCkSzEDOfMuHPmbzSD5Pp2Bb5U/69MnEvpc4YfW2Y1BJqJpcaam04+fR0kF8n5xm8b6MQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"no-case": {
|
"no-case": {
|
||||||
"version": "2.3.2",
|
"version": "2.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz",
|
||||||
|
|
|
@ -61,7 +61,8 @@
|
||||||
"gulp-size": "^3.0.0",
|
"gulp-size": "^3.0.0",
|
||||||
"gulp-sourcemaps": "^2.6.5",
|
"gulp-sourcemaps": "^2.6.5",
|
||||||
"gulp-uglify": "^2.1.2",
|
"gulp-uglify": "^2.1.2",
|
||||||
"gulp-useref": "^3.1.6"
|
"gulp-useref": "^3.1.6",
|
||||||
|
"nice-try": "^2.0.0"
|
||||||
},
|
},
|
||||||
"name": "ariang",
|
"name": "ariang",
|
||||||
"description": "AriaNg, a modern web frontend making aria2 easier to use.",
|
"description": "AriaNg, a modern web frontend making aria2 easier to use.",
|
||||||
|
|
Reference in a new issue