From d0c3e368202e5e55d1e7eecc7616f09f7d7d4f2e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sauli=20T=C3=A4hk=C3=A4p=C3=A4=C3=A4?= Date: Tue, 30 Aug 2016 09:58:27 +0300 Subject: [PATCH] Remove masterBowerPath --- tasks/cdn.js | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/tasks/cdn.js b/tasks/cdn.js index 05a8bbd..0db7bb9 100644 --- a/tasks/cdn.js +++ b/tasks/cdn.js @@ -14,32 +14,30 @@ var version = config.version; var host = config.toolsHost; var permalink = config.permalink; var stagingPath = path.join(process.cwd(), stagingBasePath, version); -var masterBowerPath = config.paths.staging.bower; gulp.task('clean:cdn', function() { fs.removeSync(stagingBasePath); }); -gulp.task('clean:bower', function() { - fs.removeSync(masterBowerPath); -}); - -gulp.task('cdn:stage-bower.json', function() { +gulp.task('cdn:stage-bower.json', ['clean:cdn'], function() { // Load the bower.json, assign overrides and write back to disk. let bowerJson = JSON.parse(fs.readFileSync('./bower.json', 'utf-8')); - bowerJson = Object.assign(bowerJson, bowerJson.masterOverrides); - delete bowerJson.masterOverrides; - fs.mkdirSync(masterBowerPath); - fs.writeFileSync(masterBowerPath + '/bower.json', JSON.stringify(bowerJson, null, ' ')); - gutil.log('Created ' + masterBowerPath + '/bower.json with overrides applied.'); + if (version === 'master') { + gutil.log('Applying overrides to ' + stagingPath + '/bower.json'); + bowerJson = Object.assign(bowerJson, bowerJson.masterOverrides); + delete bowerJson.masterOverrides; + } + + fs.mkdirSync(stagingBasePath); + fs.mkdirSync(stagingPath); + fs.writeFileSync(stagingPath + '/bower.json', JSON.stringify(bowerJson, null, ' ')); }); gulp.task('cdn:stage-bower_components', ['cdn:stage-bower.json'], function() { - const bowerJsonPath = path.join(process.cwd(), (version === 'master' ? masterBowerPath : '')); return bower({ - directory: stagingPath, - cwd: bowerJsonPath, + directory: '.', + cwd: stagingPath, forceLatest: true, cmd: 'install' }); @@ -62,7 +60,7 @@ gulp.task('cdn:stage-vaadin-core-elements', function() { .pipe(gulp.dest(stagingPath + '/vaadin-core-elements')); }); -gulp.task('stage:cdn', ['clean:cdn', 'clean:bower', 'cdn:stage-bower_components', 'cdn:stage-vaadin-core-elements']); +gulp.task('stage:cdn', ['clean:cdn', 'cdn:stage-bower_components', 'cdn:stage-vaadin-core-elements']); gulp.task('upload:cdn', ['stage:cdn'], function() { common.checkArguments(['cdnUsername', 'cdnDestination']); -- 2.39.5