Skip to content

Commit 6fc5249

Browse files
committed
fix: Override vinyl-ftp _mkfirp function to avoid file detection/rejection on symbolic links.
1 parent a8722eb commit 6fc5249

1 file changed

Lines changed: 24 additions & 12 deletions

File tree

lib/gulp/deploy.js

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,31 @@ module.exports = function (gulp, options) {
6363
utils.log.log('⤷ Deploying zipped files');
6464

6565
const conn = ftp.create({
66+
debug: utils.log.debug,
6667
host: options.ftp.host,
67-
user: options.ftp.user,
68-
password: options.ftp.pass,
69-
parallel: 10,
7068
log: utils.log.verbose,
71-
debug: utils.log.debug
69+
parallel: 10,
70+
password: options.ftp.pass,
71+
user: options.ftp.user
7272
});
7373

74-
gulp.src(path.join(options.paths.deploy, '**', '*.zip'), {
75-
buffer: false
74+
/**
75+
* Overide function as there's an error in the vinyl-ftp module.
76+
* Error: when checking the remote's directory (based on glob's path), if there's a symbolic link (a file),
77+
* an error is thrown.
78+
*/
79+
conn._mkdirp = {
80+
get: function (path, cb){
81+
return cb();
82+
}
83+
};
84+
85+
gulp.src(path.join('**', '*.zip'), {
86+
buffer: false,
87+
cwd: options.paths.deploy,
7688
})
7789
.pipe(plumber())
78-
.pipe(conn.dest('/'))
90+
.pipe(conn.dest('content'))
7991
.on('error', function (err) {
8092
reject(err);
8193
})
@@ -91,20 +103,20 @@ module.exports = function (gulp, options) {
91103
utils.log.log('⤷ Deploying control files');
92104

93105
const conn = ftp.create({
106+
debug: utils.log.debug,
94107
host: options.ftp.host,
95-
user: options.ftp.user,
96-
password: options.ftp.pass,
97-
parallel: 10,
98108
log: utils.log.verbose,
99-
debug: utils.log.debug
109+
parallel: 10,
110+
password: options.ftp.pass,
111+
user: options.ftp.user
100112
});
101113

102114

103115
gulp.src(path.join(options.paths.deploy, '**', '*.ctl'), {
104116
buffer: false
105117
})
106118
.pipe(plumber())
107-
.pipe(conn.dest(options.ftp.remotePath))
119+
.pipe(conn.dest(`content/ctlfile`))
108120
.on('error', function (err) {
109121
reject(err);
110122
})

0 commit comments

Comments
 (0)