Rev | Line | |
---|
[10918] | 1 | #!/bin/sh |
---|
| 2 | |
---|
| 3 | # A wrapper script to execute grunt commands in an environment where a |
---|
| 4 | # local version of nodejs and `grunt` is defined. |
---|
| 5 | # |
---|
| 6 | # To create a 'distribution' run: ``grunt dist`` |
---|
| 7 | # To run tests do: ``grunt test`` |
---|
| 8 | # |
---|
| 9 | OLD_PATH=`pwd` |
---|
| 10 | # prepend nodejs bin-dir on PATH |
---|
| 11 | PATH="${buildout:parts-directory}/nodejs/bin:$PATH" |
---|
[10938] | 12 | BOOTSTRAP_DIR=${buildout:directory}/layout/bootstrap/ |
---|
[10918] | 13 | NPM=${buildout:parts-directory}/nodejs/bin/npm |
---|
| 14 | echo "Changing to $BOOTSTRAP_DIR" |
---|
| 15 | cd $BOOTSTRAP_DIR |
---|
| 16 | # reinstall grunt if neccessary... |
---|
| 17 | if [ ! -d node_modules ]; then |
---|
| 18 | echo "grunt missing. Reinstalling..." |
---|
| 19 | $NPM install -g grunt-cli |
---|
| 20 | $NPM install |
---|
| 21 | fi |
---|
| 22 | # call `grunt` with all commandline args. |
---|
| 23 | grunt $* |
---|
| 24 | cd $OLD_PATH |
---|
Note: See
TracBrowser for help on using the repository browser.