Closed cybertino closed 9 years ago
I bypassed it with:
gulp.task('server', function () {
var srv = gls.new('./bin/localhost');
srv.start();
gulp.watch('./bin/localhost', function () {
srv.start();
});
});
but not sure if it has to be fixed anyway as srv.start.bind() is in documentation's example.
It's still an issue.
Also, can be fixed with:
gulp.watch('server.js', function() {
server.start.apply(server);
});
If I change this line https://github.com/gimm/gulp-live-server/blob/master/index.js#L135
execPath -> 'node'
this.server = spawn('node', this.config.args, this.config.options);
it works. but apparently would break something with coffeescript. what should be the correct way of restarting the server?
I have this line but wouldn't work.
gulp.watch(['server/**/*.js'], server.start.bind(server));
@den-mentiei solution works, I will go with that for now.
@douglas-vaz solution works and is better :) Can we have it merged in? (#33)
Thanks for the merge :)
@douglas-vaz more than welcome
I have this piece of code:
When I launch it the output is:
But if I change the "bin/localhost" file I get this error:
My small investigation showed that the first parameter of ChildProcess.spawn is an object:
but according to method's documentation it is supposed to be a string:
https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options
Is that an issue?