Last active
August 29, 2015 14:23
-
-
Save josketres/0e90b4e2b4a9e414708c to your computer and use it in GitHub Desktop.
Grunt-cli wrapper
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
#!/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