Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor in Git Shell (mingw)

I am trying to do the tutorial for Meteor JS but I can't get it to work properly using the Git Shell that comes with Github for Windows. It can't find the meteor command. It works in cmd and it is in the Windows environment path. What am I doing wrong?

like image 369
Sean Avatar asked Apr 23 '15 22:04

Sean


1 Answers

To run a *.bat command from MinGW's MSYS shell, you must redirect the execution to cmd.exe, thus:

cmd //c foo.bat [args ...]

The foo.bat command file must be in a directory within $PATH, (or you must specify the full path name ... using slashes, not backslashes unless you use two of them for each path name separator). Also, note the double slash to inform cmd.exe that you are using its /C option, (since it doesn't accept the -c form preferred by the MSYS shell.

If you'd like to make the foo.bat file directly executable from the MSYS shell, you may create a two line Bourne shell wrapper script called simply foo alongside it, (in the same directory as foo.bat), thus:

#!/bin/sh
cmd //c "$0.bat" "$@"

(so in your case, you'd create script file meteor alongside meteor.bat).

In fact, since this wrapper script is entirely generic, provided your file system supports hard file links, (as NTFS does for files on one single disk partition), you may create one wrapper script, and link it to as many command file names as you have *.bat files you'd like to invoke in this manner; (hint: use the MSYS ln command to link the files).

like image 61
Keith Marshall Avatar answered Sep 18 '22 10:09

Keith Marshall