Skip to content

Instantly share code, notes, and snippets.

@HichemBenChaaben
Last active December 21, 2015 15:48
Show Gist options
  • Save HichemBenChaaben/6328947 to your computer and use it in GitHub Desktop.
Save HichemBenChaaben/6328947 to your computer and use it in GitHub Desktop.
#!/bin/bash
#bash script for initiate grunt project
echo "We can't made node.js part of this installation"
echo "You need to install node js"
echo "
git clone git://github.com/ry/node.git
cd node
./configure
make
sudo make install "
echo ""
while true; do
read -p "Do you want to continue (Y/N)?" answer
case $answer in
[Yy]* ) echo "YES, High 5*"; break;;
[Nn]* ) echo "Abort"; exit;;
* ) echo "Please answer yes or no.";;
esac
done
mkdir -v "grunt"
cd "grunt"
#get grunt command line
sudo npm install -g grunt-cli
echo "Registering grunt"
sudo npm install grunt --save-dev
#Create the grunt file
if [ -f "Gruntfile.js" ]; then
#statements
cat >> gruntfile.js
echo "Creating the grunt file"
fi
# test of pacakge.json exists
if [ ! -f package.json ]; then
#Create the package init
sudo npm init
fi
echo "Getting grunt contrib dependencies"
# There is a contrib suite wich has almost all packages here
# https://npmjs.org/package/grunt-contrib
echo "Getting Compass"
sudo npm install grunt-compass
echo "Registering compass"
sudo npm install grunt-compass --save-dev
echo "Getting Jshint"
sudo npm install grunt-contrib-jshint
echo "Registering Jshint"
sudo npm install grunt-contrib-jshint --save-dev
echo "Getting Uglify...."
sudo npm install grunt-contrib-uglify
echo "Registering grunt-contrib-uglify"
sudo npm install grunt-contrib-uglify --save-dev
echo "Getting Imagemin"
sudo npm install grunt-contrib-imagemin
echo "Registering Imagemin"
sudo npm install grunt-contrib-imagemin --save-dev
echo "Getting contrib watch"
sudo npm install grunt-contrib-watch
echo "Registering grunt-contrib-watch"
sudo npm install grunt-contrib-watch --save-dev
echo "Getting remove logging"
sudo npm install grunt-remove-logging
echo "Registering Remove logging"
sudo npm install grunt-remove-logging --save-dev
echo "Job ended start using grunt by running $ grunt"
echo "~~~~~~~~~~~~~~~ dubizzle Mena ~~~~~~~~~~~~~~~"
if [ -f gruntfile.js ]; then
# this part of the script is a helper you can get rid of it
echo "Getting an example of a grunt configuration file, change here necessary"
git clone /HichemBenChaaben/48fb5783ccb40e90b97c/
cd 48fb5783ccb40e90b97c
mv gruntfile.js ../
cd ../
rm -r -v 48fb5783ccb40e90b97c
echo "grunt file Created start using grunt now"
fi
#end of the script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment