port the shell script to nodejs, so it is easier to do grunt task