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

meanworks verify for mongodb problem 2 #3

Closed
jsjqian opened this issue Jan 5, 2016 · 3 comments
Closed

meanworks verify for mongodb problem 2 #3

jsjqian opened this issue Jan 5, 2016 · 3 comments

Comments

@jsjqian
Copy link

jsjqian commented Jan 5, 2016

Because of a space in the folder name, an error is produced when running 'meanworks verify' for problem 2

@TylerMoeller
Copy link

Same here - fails on Windows but passes on OS X.

C:\meanworks>meanworks verify
MEANWorks is verifying that MongoDB is installed... Please stand by
Uh oh!  mongodb had a problem! {"killed":false,"code":1,"signal":null,"cmd":"C:\\Windows\\system32\\cmd.exe /s
 /c \"\"\"c:\\Program Files\\MongoDB\\Server\\3.2\\bin\\mongod.EXE\"\" --version\""}
'""c:\Program' is not recognized as an internal or external command,
operable program or batch file.
#########################################
###   YOUR SOLUTION IS NOT CORRECT!   ###
#########################################

The fix is to remove lines 22-25 from index.js:

    // Surrounds with double quotes if path contains a space
    if (mongod.indexOf(' ') != -1) {
      mongod = '"' + mongod + '"';
    }

I haven't tried that on Linux, but it works on Windows + OS X without these lines of code.

Another possible alternative is to skip if on Windows (and change != to !== while we're at it):

var os = require('os');
if (os.type() !== 'Windows_NT') {    
// Surrounds with double quotes on non-Windows OS if path contains a space
  if (mongod.indexOf(' ') !== -1) {
    mongod = '"' + mongod + '"';
  }
}

If you are happy with one of these solutions, I'm happy to submit a PR. Just notifying you with more details for now.

@jsjqian
Copy link
Author

jsjqian commented Jan 15, 2016

I implemented the first change and it worked perfectly. Thanks for the quick response and solution!

@azat-co
Copy link
Owner

azat-co commented Jan 15, 2016

@jsjqian @TylerMoeller i pushed the fix in 2.0.6: I had duplicate code doing the same thing. dcea9e4

@azat-co azat-co closed this as completed Jan 15, 2016
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

3 participants