node.js - gulp is not calling the callback -- it just hangs at end of task -



node.js - gulp is not calling the callback -- it just hangs at end of task -

callback firing, task hangs on finished 'hooks:pull' after 2.04 s

gulp.task('hooks:pull', function(callback){ var files = [ { remote: '~/deploy/test.example.com/hooks/post-receive', local: './bin/post-receive.test' }, { remote: '~/deploy/staging.example.com/hooks/post-receive', local: './bin/post-receive.staging' }, { remote: '~/deploy/example.com/hooks/post-receive', local: './bin/post-receive.production' } ]; async.each(files, function(file, cb) { var opts = { host: 'example.com' }; opts.file = file.remote; opts.path = file.local; scp.get(opts, function(err) { if (err) { console.error(err); homecoming cb(err); } console.log('%s hook has been pulled!', file.local); cb(); }); }, function(err){ if ( err ) { console.error(err); homecoming callback(err); } callback(); }); });

how phone call callback , exit/return?

just running gulp hooks:pull

if node hangs instead of exiting, presumably task still running.

you can utilize gulp stop hook kill it, or exit whole thing if don't care (and if don't start async cleanup functions in tasks).

this should it:

process = require("process"); gulp.on('stop', function() { process.exit(0); }

node.js gulp

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -