Skip to content

Instantly share code, notes, and snippets.

@pedro-stanaka
Last active August 29, 2015 14:17
Show Gist options
  • Save pedro-stanaka/4cb4c881c312fe60c95f to your computer and use it in GitHub Desktop.
Save pedro-stanaka/4cb4c881c312fe60c95f to your computer and use it in GitHub Desktop.
Bootstrap a new static site - Using Sass + Coffee + HTML5_BP
#!/bin/bash
####
# To use this script I'd recommend installing RVM
#####
# Check dependencies
command -v gem >/dev/null 2>&1 || { echo >&2 "I require rubygems but it's not installed. Aborting."; exit 1; }
command -v git >/dev/null 2>&1 || { echo >&2 "I require git but it's not installed. Aborting."; exit 1; }
\wget http://www.initializr.com/builder\?boot-hero\&jquerymin\&h5bp-iecond\&h5bp-chromeframe\&h5bp-analytics\&h5bp-favicon\&h5bp-appletouchicons\&modernizrrespond\&izr-emptyscript\&boot-css\&boot-scripts -O temp-file.zip
unzip temp-file.zip
mv initializr $1
rm -f temp-file.zip
cd $1
mkdir -p assets/coffee
mkdir -p assets/sass
git clone https://gist.github.com/594f767fe316d1b5729d.git tmp-repo
mv tmp-repo/* assets
rm -rf tmp-repo
command -v thor >/dev/null 2>&1 || {
gem install thor --no-ri --no-rdoc
}
command -v watchr >/dev/null 2>&1 || {
gem install watchr --no-ri --no-rdoc
}
command -v bundle >/dev/null 2>&1 || {
gem install bundler --no-ri --no-rdoc
}
cd assets
bundle init
echo 'gem "sass"' >> Gemfile
echo 'gem "bootstrap-sass"' >> Gemfile
echo 'gem "compass"' >> Gemfile
bundle exec compass create sass --sass-dir "src" --css-dir "../../css" --javascripts-dir "../../js" --images-dir "../../img" --fonts-dir "../../fonts" --http-path "/"
echo "In order to 'live' compile all your assets, just go inside the assets folder and run:
"
echo "thor convert:watch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment