From: Manolo Carrasco Date: Thu, 1 Oct 2015 09:16:57 +0000 (+0200) Subject: Remove _components root folder in zip file. Added clean X-Git-Tag: 0.3.0-beta10~2^2~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=60e7b3c0273e7b332c3bcab84636f5be1b823089;p=vaadin-core.git Remove _components root folder in zip file. Added clean --- diff --git a/tasks/docsite.js b/tasks/docsite.js index c31683c..decede9 100644 --- a/tasks/docsite.js +++ b/tasks/docsite.js @@ -17,6 +17,14 @@ var host = config.cdnHost; var permalink = config.permalink; var stagingPath = stagingBasePath + '/' + version; var modify = require('gulp-modify'); +var rootZip = 'target/'; +var fileZip = 'docsite.zip' + + +gulp.task('cdn:docsite:clean', function() { + fs.removeSync(docPath); + fs.removeSync(rootZip + fileZip); +}); gulp.task('cdn:docsite:bower_components', ['cdn:stage-bower_components'], function() { gutil.log('Copying bower components from ' + stagingPath + ' to ' + docPath + '/bower_components'); @@ -66,23 +74,19 @@ config.components.forEach(function (n) { }); gulp.task('cdn:docsite:zip', doctasks, function() { - var src = docPath + '/../**/*'; - var root = 'target'; - var file = 'docsite.zip'; - gutil.log("Creating docsite zip " + docPath + " -> " + root + '/' + file); + var src = docPath + '/**/*'; + gutil.log("Creating docsite zip " + docPath + " -> " + rootZip + fileZip); return gulp.src(src) - .pipe(zip(file)) - .pipe(gulp.dest(root)); + .pipe(zip(fileZip)) + .pipe(gulp.dest(rootZip)); }); -gulp.task('cdn:docsite:upload', ['cdn:docsite:zip'], function(done) { +gulp.task('cdn:docsite:upload', ['cdn:docsite:clean', 'cdn:docsite:zip'], function(done) { common.checkArguments(['cdnUsername', 'cdnDestination']); - var root = 'target'; - var file = 'docsite.zip'; - gutil.log('Uploading docsite (scp): ' + root + '/' + file + ' -> ' + args.cdnUsername + '@' + host + ':' + args.cdnDestination + version); + gutil.log('Uploading docsite (scp): ' + rootZip + fileZip + ' -> ' + args.cdnUsername + '@' + host + ':' + args.cdnDestination + version); - require('scp2').scp(root + '/' + file, { + require('scp2').scp(rootZip + fileZip, { host: host, username: args.cdnUsername, privateKey: config.paths.privateKey(),