#!/bin/sh # A wrapper script to execute grunt commands in an environment where a # local version of nodejs and `grunt` is defined. # # To create a 'distribution' run: ``grunt dist`` # To run tests do: ``grunt test`` # OLD_PATH=`pwd` # prepend nodejs bin-dir on PATH PATH="${buildout:parts-directory}/nodejs/bin:$PATH" BOOTSTRAP_DIR=${buildout:directory}/src/bootstrap NPM=${buildout:parts-directory}/nodejs/bin/npm echo "Changing to $BOOTSTRAP_DIR" cd $BOOTSTRAP_DIR # reinstall grunt if neccessary... if [ ! -d node_modules ]; then echo "grunt missing. Reinstalling..." $NPM install -g grunt-cli $NPM install fi # call `grunt` with all commandline args. grunt $* cd $OLD_PATH