-
Notifications
You must be signed in to change notification settings - Fork 209
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
Uses cross-spawn-async for Windows compatibility #53
Conversation
Replaced `child_process.spawn` with `cross-spawn-async` for cross-platform compatibility. (Windows command line has problems with `child_process.spawn`.)
Can you write tests for this? I'd like confirmation that this works on all environments, because I haven't spun up a VM with Windows myself. We can test on more environments on TravisCI. |
Great work and thank you very much, btw :) |
👍 I'll try and get proper tests written over the weekend (unexpectedly busy afternoon in the office, otherwise I'd have had a go already). So far the testing has been "does this work on my Windows machine" (it does) and Travis giving the thumbs up :) |
(Travis testing on non-Windows boxes I mean by that) |
Thanks so much! Understand the busy office situation. Same here. ;) |
@keithwhor considering that you can't run Windows tests on Travis do you plan to intergrate something like appveyor for the tests? I can write the test (depending on what you would expect) as I am in dire need for this PR to be merged so I can develop on my Windows setup. |
Tests are going to be hard to achieve for a while - I'm having an absolute nightmare getting the tests to start on Windows. Adjusting the |
Hey, if you guys are confident this works as intended I have no problem merging at this point. If tests are a nightmare let's just not worry about it. |
That sounds awful :( I might give it a go today and see what I can do. Is this only applicable to runner.js? |
@keithwhor are you working on an db adapter system like sails' waterline or sticking with SQL for now? Because we could re-write this in the new CLI changes. |
@schahriar We have a built in db adapter system, not sure what you're asking? |
@keithwhor I was referring to support for other databases (MySQL, Mongo, etc.) but nvm I confused runner.js with the rest of the code forgetting that it was part of the test. |
@IrregularShed I got |
@schahriar You're added :) |
Invoking `psql` through child_process is a bad idea and as we can see here the behavior is not only inconsistent but rather slow on windows. This patch adds a few options to the exec command in order to keep `psql` sane on Windows.
Seems like fixes for Windows are breaking everything else. I'll setup a bunch of test servers to test the latest commit before pushing it to the CI. |
Only way to get it to work on both Windows & Linux (I haven't tested OSX but I am assuming it would work since the fallback code is the original)
Looks good to me. Ran fine. |
Uses cross-spawn-async for Windows compatibility
Replaced
child_process.spawn
withcross-spawn-async
for cross-platformcompatibility. (Windows command line has problems with
child_process.spawn
.)