Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rename reload mode to watch mode to match conventions established by …

…supervisor, nodemon, mocha, etc.
  • Loading branch information...
commit 5c2355f4e60bfaecc8a2b214dcf039aa8125f29c 1 parent 8384c91
@jaredhanson authored
View
2  bin/lcm.js
@@ -17,7 +17,7 @@ program.command('server')
.option('-p, --port [port]', 'listen on specified port (default: 3000)', parseInt)
.option('-e, --env [environment]', 'run in specified environment (default: development)')
.option('-A, --app [directory]', 'load app at specified directory (default: `pwd`)')
- .option('-R, --reload', 'enable automatic reloading when code changes')
+ .option('-w, --watch', 'watch for code changes and reload')
.option('--use-nodemon', 'use nodemon for automatic reloading (default: supervisor)')
.option('--debug [port]', 'enable V8 debugger on specified port (default: 5858)', parseInt)
.option('--debug-brk [port]', 'enable V8 debugger on specified port and break immediately (default: 5858)', parseInt)
View
18 lib/locomotive/cli/server.js
@@ -41,22 +41,14 @@ exports = module.exports = function server(dir, address, port, env, options) {
return;
}
- if (options.reload) {
+ if (options.watch) {
if (options.useNodemon) {
- // As of nodemon@0.6.14, there is an issue with passing the full path of a
- // script to nodemon, which causes the spawned command to fail. See here
- // for more discussion:
- // https://github.com/remy/nodemon/issues/78
- //
- // I've submitted a pull request to fix this issue, which will hopefully
- // find its way into a stable release.
- // https://github.com/remy/nodemon/pull/81
var command = 'nodemon';
var args = [ '-w', dir,
- path.join(__dirname, 'server/reload.js'),
+ path.join(__dirname, 'server/watch.js'),
dir, address, port, env ];
- debug('respawning in reload mode (%s %s)', command, args.join(' '));
+ debug('respawning in watch mode (%s %s)', command, args.join(' '));
var proc = spawn(command, args);
proc.stdout.pipe(process.stdout);
@@ -75,10 +67,10 @@ exports = module.exports = function server(dir, address, port, env, options) {
// supervisor@0.3.0
var command = 'supervisor';
var args = [ '-w', dir, '--no-restart-on', 'error',
- '--', path.join(__dirname, 'server/reload.js'),
+ '--', path.join(__dirname, 'server/watch.js'),
dir, address, port, env ];
- debug('respawning in reload mode (%s %s)', command, args.join(' '));
+ debug('respawning in watch mode (%s %s)', command, args.join(' '));
var proc = spawn(command, args);
proc.stdout.pipe(process.stdout);
View
4 lib/locomotive/cli/server/reload.js → lib/locomotive/cli/server/watch.js
@@ -1,7 +1,7 @@
/**
- * server/reload.js
+ * server/watch.js
*
- * This is a shim script used by Locomotive when respawning in reload mode.
+ * This is a shim script used by Locomotive when respawning in watch mode.
*/
// process.argv[0] -> nodemon
Please sign in to comment.
Something went wrong with that request. Please try again.