Skip to content

Commit

Permalink
WA代码:添加 gulp dist 功能
Browse files Browse the repository at this point in the history
  • Loading branch information
amio committed Feb 21, 2014
1 parent 0cf6acc commit 5edf88b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
23 changes: 22 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,28 @@ gulp.task('clean', function () {
.pipe(clean());
});

gulp.task('default', ['serverdev']);
gulp.task('build', ['clean'], function () {
gulp.start('usemin', 'copy');
});

var sh = function (commands) {
var exec = require('child_process').exec;
var sys = require('sys');
for (var i = 0, l = arguments.length; i < l; i++) {
exec(arguments[i], function (error, stdout, stderr) {
if (error != null) {
sys.print('exec error: ' + error);
} else {
sys.print(stdout);
sys.print(stderr);
}
});
}
};

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');
});

gulp.task('default', ['serverdev']);
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"version": "0.0.0",
"dependencies": {},
"devDependencies": {
"gulp": "~3.5.0",
"gulp-util": "~2.2.0",
"open": "~0.0.4",
"express": "~3.4.7",
"tiny-lr": "~0.0.5",
"gulp": "^3.5.0",
"gulp-util": "^2.2.0",
"open": "^0.0.4",
"express": "^3.4.7",
"tiny-lr": "^0.0.5",
"connect-livereload": "*",
"gulp-usemin": "^0.3.1",
"gulp-uglify": "^0.2.1",
Expand Down

0 comments on commit 5edf88b

Please sign in to comment.