#!/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 $*