Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sourcedir not working? #229

Closed
quartzo opened this issue Jan 17, 2012 · 3 comments
Closed

sourcedir not working? #229

quartzo opened this issue Jan 17, 2012 · 3 comments

Comments

@quartzo
Copy link

quartzo commented Jan 17, 2012

It seems that this line from cli.js overides any command line option:
options.sourceDir = file && file[0] !== '/' ? process.cwd() : '/';

@hbstone
Copy link

hbstone commented Jan 25, 2012

Agreed, logging process.cwd in my script displays "/" no matter what I pass to --sourceDir.

@dimsmol
Copy link

dimsmol commented Feb 7, 2012

The bug is in the cli.js, getOptions() function:

[
    'pidFile', 'logFile', 'errFile', 'watch', 'minUptime', 'appendLog',
    'silent', 'outFile', 'max', 'command', 'path', 'spinSleepTime', 
    'sourceDir', 'uid'
].forEach(function (key) {
    options[key] = app.config.get(key);
});

options.sourceDir = file && file[0] !== '/' ? process.cwd() : '/';
if (options.sourceDir) {
    options.spawnWith = {cwd: options.sourceDir};
}

As you can see, options.sourceDir will be overwritten, no matter what was passed with --sourceDir.
There is no workaround, unfortunately.

@hbstone
Copy link

hbstone commented Feb 7, 2012

Yep, quartzo mentioned that above. It seems the easy fix would be just moving the override up, so the command line overrides the default instead of the other way around.

options.sourceDir = file && file[0] !== '/' ? process.cwd() : '/';
[
'pidFile', 'logFile', 'errFile', 'watch', 'minUptime', 'appendLog',
'silent', 'outFile', 'max', 'command', 'path', 'spinSleepTime',
'sourceDir', 'uid'
].forEach(function (key) {
options[key] = app.config.get(key);
});

if (options.sourceDir) {
options.spawnWith = {cwd: options.sourceDir};
}

michaelcdillon pushed a commit to michaelcdillon/forever that referenced this issue Feb 17, 2012
- changed the --pidfile to --pidFile
- changed the awk line to use the default column numbers for forever list output
- fixed the inability to execute the script from outside the source directory
by referencing and implementing the suggestions in this issue: foreversd#229
michaelcdillon pushed a commit to michaelcdillon/forever that referenced this issue Feb 17, 2012
- changed the --pidfile to --pidFile
- changed the awk line to use the default column numbers for forever list output
- fixed the inability to execute the script from outside the source directory
by referencing and implementing the suggestions in this issue: foreversd#229
@bmeck bmeck closed this as completed Feb 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants