Skip to content

Commit 1ad16b0

Browse files
bmeckAvianFlu
authored andcommitted
[pull-request] #244, from @michaelcdillon
1 parent ea5317c commit 1ad16b0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/initd-example

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ start() {
4040

4141
# Launch the application
4242
start_daemon
43-
$forever start -p $forever_dir --pidfile $pidfile -l $logfile -a -d $INSTANCE_DIR $SOURCE_NAME
43+
$forever start -p $forever_dir --pidFile $pidfile -l $logfile -a -d $INSTANCE_DIR $SOURCE_NAME
4444
RETVAL=$?
4545
else
4646
echo "Instance already running"
@@ -70,7 +70,7 @@ stop() {
7070

7171
getForeverId() {
7272
local pid=$(pidofproc -p $pidfile)
73-
$forever list -p $forever_dir | $sed -e 's/\x1b\[[0-9; ]*m//g' | $awk "\$4 == \"$pid]\" { gsub(/[\[\]]/, \"\", \$1); print \$1; }"
73+
$forever list -p $forever_dir | $sed -e 's/\x1b\[[0-9; ]*m//g' | $awk "\$6 && \$6 == \"$pid\" { gsub(/[\[\]]/, \"\", \$2); print \$2; }";
7474
}
7575
id=$(getForeverId)
7676

lib/forever/cli.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ var getOptions = cli.getOptions = function (file) {
195195
options[key] = app.config.get(key);
196196
});
197197

198-
options.sourceDir = file && file[0] !== '/' ? process.cwd() : '/';
198+
options.sourceDir = options.sourceDir || (file && file[0] !== '/' ? process.cwd() : '/');
199199
if (options.sourceDir) {
200200
options.spawnWith = {cwd: options.sourceDir};
201201
}

0 commit comments

Comments
 (0)