Skip to content

feature: use rechoir#384

Merged
nfischer merged 3 commits intomasterfrom
feat-use-rechoir
Mar 11, 2016
Merged

feature: use rechoir#384
nfischer merged 3 commits intomasterfrom
feat-use-rechoir

Conversation

@nfischer
Copy link
Copy Markdown
Member

@nfischer nfischer commented Mar 5, 2016

This is a redo of #258, since it looks like it may have been abandoned.

@nfischer
Copy link
Copy Markdown
Member Author

nfischer commented Mar 5, 2016

@TimothyGu thanks for the command. Fixed it.

If someone could please review this, that would be much appreciated.

@nfischer nfischer added this to the v0.7.0 milestone Mar 5, 2016
test/shjs.js Outdated
path.resolve(__dirname, '../bin/shjs') +
' ' +
path.resolve(__dirname, 'resources', 'shjs', name), { silent: true });
var cmd = (process.platform === 'win32' ? 'node ' : '') + path.resolve(__dirname, '../bin/shjs');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if I have already mentioned this, but the best way to spawn another node process is through process.argv[0]. On both Unix and Windows, node refers to the executable in PATH, while the user might have executed the script with the absolute path to another node executable. process.argv[0] guarantees that the current used Node.js is always used.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that works. So does process.execPath I believe. I'll adjust.

@nfischer
Copy link
Copy Markdown
Member Author

nfischer commented Mar 5, 2016

Updated the tests to use process.execPath instead of "node" to make things more robust.

@ariporad
Copy link
Copy Markdown
Contributor

ariporad commented Mar 5, 2016

It looks like the tests aren't passing, otherwise looks good.

@nfischer
Copy link
Copy Markdown
Member Author

nfischer commented Mar 5, 2016

Yeah, I see the issue. I just need to wrap process.execPath with JSON.stringify(). Or you can take out the last commit and merge that (it's only the execPath stuff that broke tests). Away from my computer at the moment

@nfischer
Copy link
Copy Markdown
Member Author

@ariporad I just updated this. This should fix the issue.

@ariporad
Copy link
Copy Markdown
Contributor

LGTM, will merge once tests pass.

@nfischer
Copy link
Copy Markdown
Member Author

Sorry, just found another issue. Now it should be resolved.

@nfischer
Copy link
Copy Markdown
Member Author

Merging this, since it LGTM

nfischer added a commit that referenced this pull request Mar 11, 2016
@nfischer nfischer merged commit 588d84d into master Mar 11, 2016
@nfischer nfischer deleted the feat-use-rechoir branch March 11, 2016 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants