1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | var combiner = require('stream-combiner2');
|
8 | var vfs = require('vinyl-fs');
|
9 | var vftp = require('vinyl-ftp');
|
10 | var vpath = require('vinyl-paths');
|
11 | var readline = require('readline-sync');
|
12 |
|
13 | module.exports = function(gulp, $, conf) {
|
14 | gulp.task('deploy', function() {
|
15 | if (conf.ftp.pass === '') {
|
16 | conf.ftp.pass = readline.question('Type your ftp server\'s password: ');
|
17 | }
|
18 |
|
19 |
|
20 | var ftpSvr = vftp.create({
|
21 | host : conf.ftp.host,
|
22 | user : conf.ftp.user,
|
23 | password : conf.ftp.pass,
|
24 | port : conf.ftp.port,
|
25 | parallel : 5,
|
26 | log : $.util.log,
|
27 | });
|
28 |
|
29 | vfs.src([conf.parsePwd([conf.dist, '/**'].join(''))], { buffer: false })
|
30 | .pipe(ftpSvr.dest(conf.ftp.path));
|
31 | });
|
32 | }
|