Created
June 27, 2012 14:39
-
-
Save aaronj1335/3004474 to your computer and use it in GitHub Desktop.
improper handling of command line arguments in node 0.8.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo 'console.log(process.argv);' > test.js | |
| node test.js /static | |
| # prints out ['C\\:Program Files\\nodejs\\node.exe', 'C:\\Users\\astacy\\code\\daft\\test.js', 'C:/Program Files/Git/static'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| node test.js /static | |
| REM prints out ['node', 'C:\\Users\\astacy\\code\\daft\\test.js', '/static'] |
Author
Author
also, this behavior started when i upgraded to 0.8.0.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the problem is that when i run the same command in the git-bash shell (mingw) and the command prompt:
i get two different results for the last command line argument, 'C:/Program Files/Git/static' in git-bash (which is incorrect, but i need git-bash for my dev environment) and '/static' in windows command prompt (which is correct, but is of no use to me).
at first i figured this was a problem with my mingw environment, but then running
echo /staticworks correctly in mingw -- it prints out '/static' instead of the full path rooted atC:/how do i get
run_in_mingw.shto work correctly in the git-bash shell?