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
Post a Comment