Port of manage.sh from Bash to Grunt