-
Notifications
You must be signed in to change notification settings - Fork 733
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
Rewrite exec using execsync-ng (which uses node-ffi) #66
Comments
Hey Gorgi, nice work there. I like where you're going with this, but off the top of my head here's a couple of concerns: First is cross-platform reliability. Having a native dependency might add some issues at install time (the build might break) or during runtime (the platform might not have the necessary libraries). I don't think either is a show-stopper, I just don't have enough experience with lib-ffi to know it's reliable enough at the moment. @TooTallNate ? Also, I don't have enough experience with native libs on Windows -- for example, is your dependency on Another point is that if I'm not mistaken your current implementation of Let me know your thoughts. As I said I like where you're going, and if this solution is proven to be more reliable across platforms than the current one I'm all in! PS: Let me bring a couple of other friends here to chime in: @TooTallNate and @sindresorhus |
I'd say do a hybrid approach, where node-ffi is listed in shelljs' "optionalDependencies" hash. This way, if it fails to install for whatever reason, there can still be the old-style "hack" fallback. As far as the |
^ Sounds like a good approach. |
Thanks @TooTallNate & @sindresorhus. @spion - could you issue a PR where Thanks in advance! |
Yes I can, but I'm not sure how to test the result - how would I write tests that check if execSync works both with and without the execsync-ng dependency? Perhaps by controlling whether execsync-ng is used or not through a global variable? As for the situation when msvcrt is missing, I researched a bit and came to the following conclusions
|
Node now supports |
Closing this, since we no longer support v0.10, and can utilize the synchronous functions. |
Hi,
Shelljs has been awesome so far, except for
exec
. I know how it works, with the write-to-a-temporary file loop, and I know that its a hack necessary due to the lack of child_process.execSync.Unfortunately, exec has been very buggy for me, randomly not working on various developer and server machines. Usually it gets stuck in an endless loop. I never seem to be able to satisfyingly reproduce the issue or find the cause.
So I decided to give that up and write shelljs-ffi based on execsync-ng which in turn is based on node-ffi. execsync-ng is a fork of execSync that also works on windows.
You can check out these modules at https://github.com/doxout/shelljs and https://github.com/doxout/execSync or try them out: npm install shelljs-ffi execsync-ng
I know that a native module dependency such as node-ffi is probably unacceptable for shelljs. However I decided to ask anyway... Is it possible that this fork may be accepted into shelljs?
The text was updated successfully, but these errors were encountered: