From e163321592227cf187b8b847d7489d5ba4bbc1c6 Mon Sep 17 00:00:00 2001 From: Mike Mellor Date: Fri, 22 May 2020 16:42:06 +0100 Subject: [PATCH] add timeout option and set to default 60 seconds --- tasks/ftpscript.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tasks/ftpscript.coffee b/tasks/ftpscript.coffee index 110b897..9277431 100644 --- a/tasks/ftpscript.coffee +++ b/tasks/ftpscript.coffee @@ -11,7 +11,8 @@ module.exports = exports = (grunt)-> ftpCommand: 'ftp' encoding: 'utf-8' ftpEncoding: 'utf-8' - mkdirs: on + mkdirs: on, + timeout: 60 auth = opts.auth or grunt.file.readJSON('.ftppass')?[opts.authKey ? opts.host] @@ -70,7 +71,7 @@ module.exports = exports = (grunt)-> cmds = cmds.concat dirs, files cmds = cmds.concat('quit', '').join '\n' - p = require('child_process').spawn opts.ftpCommand, ['-nv'] + p = require('child_process').spawn opts.ftpCommand, ['-nv', '-q ' + opts.timeout] done = @async() p.on 'exit', (code, signal)-> if code