From 5b4b3f5304125de1b34fba98490df6f76e72950f Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 17 Nov 2017 22:04:34 -0500 Subject: [PATCH] build number for dist files --- gulpfile.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index d411d7a3b9e..d7be7cc1b7a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -26,12 +26,21 @@ const fontsFilter = [ 'build/popup/fonts/fontawesome*.woff' ]; +function distFileName(browserName, ext) { + var fileName = `dist-${browserName}`; + if (process.env.APPVEYOR_BUILD_NUMBER && process.env.APPVEYOR_BUILD_NUMBER !== '') { + fileName += `-${process.env.APPVEYOR_BUILD_NUMBER}`; + } + + return `${fileName}.${ext}`; +} + function dist(browserName, manifest) { return gulp.src(paths.build + '**/*') .pipe(filter(['**', '!build/edge/**/*'].concat(fontsFilter))) .pipe(gulpif('popup/index.html', replace('__BROWSER__', browserName))) .pipe(gulpif('manifest.json', jeditor(manifest))) - .pipe(zip(`dist-${browserName}.zip`)) + .pipe(zip(distFileName(browserName, 'zip'))) .pipe(gulp.dest(paths.dist)); } @@ -65,7 +74,8 @@ gulp.task('dist:chrome', (cb) => { gulp.task('dist:edge', (cb) => { const edgePath = paths.dist + 'Edge/'; const extensionPath = edgePath + 'Extension/'; - const appxPath = paths.dist + 'dist-edge.appx'; + const fileName = distFileName('edge', 'appx'); + const appxPath = paths.dist + fileName; return del([edgePath, appxPath]) .then(() => edgeCopyBuild(paths.build + '**/*', extensionPath))