Skip to content

Instantly share code, notes, and snippets.

@josketres josketres/gruntw
Last active Aug 29, 2015

Embed
What would you like to do?
Grunt-cli wrapper
#!/usr/bin/env bash
# Grunt-cli wrapper script for UN*X
# https://gist.github.com/josketres/0e90b4e2b4a9e414708c
grunt_bin=grunt
grunt_check=" --version"
log_prefix="\e[95mgruntw\e[0m -"
command $grunt_bin $grunt_check >/dev/null 2>&1 || {
grunt_bin=$HOME/.gruntw/bin/grunt
echo -e "$log_prefix Global grunt-cli not found, using $grunt_bin"
command $grunt_bin $grunt_check >/dev/null 2>&1 || {
echo -e "$log_prefix $grunt_bin not found, installing it"
npm install grunt-cli -g --prefix $HOME/.gruntw
}
}
command $grunt_bin $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.