Last active
August 29, 2015 14:07
-
-
Save dgieselaar/4ab230076453f931e8ae to your computer and use it in GitHub Desktop.
If you run `npm install` on Windows, the build script creates .cmd wrappers for the package scripts in `node_modules/.bin`. This is to ensure commands like "bower install" works on Windows in your `scripts`. However, if you run `npm install` on a Unix machine, those .cmd files won't be added, which causes your scripts to fail on a Windows machin…
This file contains 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
for f in $(find './node_modules/.bin' -maxdepth 1 ! -name "*.*"); do | |
name=$(basename $f); | |
cp cmdwrap.tpl "$f.cmd"; | |
sed -i "s,PACKAGE_NAME,$name,g" $f.cmd; | |
done |
This file contains 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
@IF EXIST "%~dp0\node.exe" ( | |
"%~dp0\node.exe" "%~dp0\..\PACKAGE_NAME\bin\PACKAGE_NAME" %* | |
) ELSE ( | |
@SETLOCAL | |
@SET PATHEXT=%PATHEXT:;.JS;=;% | |
node "%~dp0\..\PACKAGE_NAME\bin\PACKAGE_NAME" %* | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment