Skip to content

Instantly share code, notes, and snippets.

@aamnah
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aamnah/6bac4fb97c931f20b3bd to your computer and use it in GitHub Desktop.
Save aamnah/6bac4fb97c931f20b3bd to your computer and use it in GitHub Desktop.
Bash function to create gruntfile.js with starter code if it doesn't already exist. Type `gruntfile` to run.
color_green='\033[92m'
color_red='\033[91m'
color_off='\033[0m'
gruntfile() {
if [ -e "gruntfile.js" ] ; then
echo -e "${color_red}gruntfile.js already exists${color_off}"
if [ -e "Gruntfile.js" ] ; then
echo -e "${color_red}Gruntfile.js already exists${color_off}"
fi
else
echo -e "
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// CONFIG
});
// PLUGINS
grunt.loadNpmTasks('');
// TASKS
grunt.registerTask('default', ['', '']);
};
" >> gruntfile.js
echo -e "${color_green}Gruntfile has been created${color_off}"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment