Skip to content

Commit

Permalink
WA代码:修正 gulp dist 远端路径为 beta 版目录
Browse files Browse the repository at this point in the history
  • Loading branch information
amio committed Feb 27, 2014
1 parent dbcd553 commit e4cc8bb
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ gulp.task('usemin', function () {
html: [minifyhtml({empty: true})],
js: [uglify(), rev()]
}))
.pipe(gulp.dest('./dist/'));
.pipe(gulp.dest(BUILD_ROOT));
});

gulp.task('imagemin', function () {
Expand All @@ -92,21 +92,14 @@ gulp.task('imagemin', function () {
});

gulp.task('copy', function () {

// Static files
gulp.src([
'!' + SOURCE_ROOT + '/*.html',
SOURCE_ROOT + '/*.*',
SOURCE_ROOT + '/font/**/*'
], {base: SOURCE_ROOT})
.pipe(gulp.dest('./dist'));

// HTML templates
gulp.src([
SOURCE_ROOT + '/font/**/*',
SOURCE_ROOT + '/partials/**/*',
SOURCE_ROOT + '/templates/**/*'
], {base: SOURCE_ROOT})
.pipe(gulp.dest('./dist'));
.pipe(gulp.dest(BUILD_ROOT));
});

gulp.task('clean', function () {
Expand Down Expand Up @@ -138,8 +131,12 @@ var sh = function (commands) {
};

gulp.task('dist', function () {
sh('rsync ' + BUILD_ROOT + '/ [email protected]:/usr/local/httpd/htdocs/tohell/html/'
+ ' -avz -e ssh --delete --exclude=.git* --exclude=*.scss --exclude=node_modules');
var target = {
beta: '[email protected]:/usr/local/httpd/htdocs/tohell/beta/html/'
};
var rsyncParams = ' -avz -e ssh --delete --exclude=.git* --exclude=*.scss --exclude=node_modules';

sh('rsync ' + BUILD_ROOT + '/ ' + target.beta + rsyncParams);
});

/**************************************
Expand Down

0 comments on commit e4cc8bb

Please sign in to comment.