Last active
August 29, 2015 14:15
-
-
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.
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
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