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

Spawn NOENT on windows #4

Open
pflannery opened this issue Jul 10, 2014 · 6 comments
Open

Spawn NOENT on windows #4

pflannery opened this issue Jul 10, 2014 · 6 comments

Comments

@pflannery
Copy link

Because node on windows needs to specify the .cmd extension when were using spawn then commands like chainy install common fail with spawn NOENT during lines like this

if we parsed all chainy-plugin-exec command lines (windows only) with a regexp that extends the first word to include .cmd then maybe we can work around with minimal fuss.

@balupton something similar to this?

command = command.replace(/^([\\\/.:\w\-]+)/ig, "$&.cmd");
@pflannery
Copy link
Author

then something like this would go here

if (process.platform === 'win32') {
    value = value.replace(/^([\\\/.:\w\-]+)/ig, "$&.cmd");
}

doing this get chainy install common working on my windows instance.

@balupton
Copy link
Member

Yeah, we should use bevry/safeps for this, it'll handle it automatically.

@balupton
Copy link
Member

actually, exec plugin already uses safeps... so we need to find out why safeps wasn't fixing this for us...
https://github.com/chainy-plugins/exec/blob/master/lib/exec.js#L4

perhaps it's because we are giving it one string instead of an array

@balupton
Copy link
Member

@pflannery
Copy link
Author

doh I didnt see your last two comments until now. It maybe because of the opts.safe not being true in the exec plugin?

I made a pr but it looks like it should handle it just not triggering ?
bevry/safeps#5

@pflannery
Copy link
Author

Looking deeper I see opts.safe is set to true by default.

The real reason is because the exec path provided by chainy-cli is using absolute path which is avoided by safeps here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants