From d654253165d9ff5303a50a67a7410190226246c8 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 16 Jan 2018 10:16:12 -0500 Subject: [PATCH] zip safari --- gulpfile.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index fb5cfefe73..6b31f31024 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -141,13 +141,15 @@ function edgeCopyAssets(source, dest) { } gulp.task('dist:safari', (cb) => { - const buildPath = paths.dist + 'bitwarden.safariextension/'; - const safariAssetsBuildPath = buildPath + 'safari/'; + const buildPath = paths.dist + 'Safari/'; + const extBuildPath = buildPath + 'bitwarden.safariextension/'; + const extAssetsBuildPath = extBuildPath + 'safari/'; return del([buildPath + '**/*']) - .then(() => safariCopyBuild(paths.build + '**/*', buildPath)) - .then(() => copy(safariAssetsBuildPath + '**/*', buildPath)) - .then(() => del([safariAssetsBuildPath])) + .then(() => safariCopyBuild(paths.build + '**/*', extBuildPath)) + .then(() => copy(extAssetsBuildPath + '**/*', extBuildPath)) + .then(() => del([extAssetsBuildPath])) + .then(() => safariZip(buildPath)) .then(() => { return cb; }, () => { @@ -166,6 +168,16 @@ function safariCopyBuild(source, dest) { }); } +function safariZip(buildPath) { + return new Promise((resolve, reject) => { + gulp.src(buildPath + '**/*') + .on('error', reject) + .pipe(zip(distFileName('safari', 'zip'))) + .pipe(gulp.dest(paths.dist)) + .on('end', resolve); + }); +} + gulp.task('build', ['lint', 'webfonts']); gulp.task('webfonts', () => {