Skip to content

Instantly share code, notes, and snippets.

@egrouse
Created May 29, 2011 20:39
Show Gist options
  • Save egrouse/998118 to your computer and use it in GitHub Desktop.
Save egrouse/998118 to your computer and use it in GitHub Desktop.
Script to setup html5-boilerplate for Ruby on Rails
#!/bin/bash
# Script to automatically setup a html5-boilerplate Rails folder
# Ellis Grouse <[email protected]>
# Instructions for use:
# mkdir appname
# cd appname
# boilerplateme
# Resource used: http://blog.vertile.com/nathan/2011/02/rvm-rails-git-html5-boiler-plate-what-more-could-you-possibly-want/
# Get the name for the application
CWD=`pwd`
APPNAME=`basename $CWD`
DONE="... Done"
# Add an empty README file
echo "Creating a default README file"
touch README.md
echo " "$DONE
# Create an empty git repository
echo "Creating a new git repository in: $CWD"
git init . >> /dev/null
git add . >> /dev/null
git commit -m "Initial commit" >> /dev/null
echo " "$DONE
# Create a new rails application
echo "Creating a new Rails application in: $CWD"
rails new . >> /dev/null
echo " "$DONE
# Add required gems to the Gemfile
echo "Updating the Gemfile"
echo "gem 'haml'" >> Gemfile
echo "gem 'compass'" >> Gemfile
echo "gem 'html5-boilerplate'" >> Gemfile
echo " "$DONE
# Run bundle install
echo "Running 'bundle install' to install any required gems"
bundle install
echo " "$DONE
# Initiate the boilerplate using compass
echo "Installing the html5-boilerplate Compass template"
compass init rails -r html5-boilerplate -u html5-boilerplate --force >> /dev/null
echo " "$DONE
# Commit the results to git
echo "Making final git commit"
git add . >> /dev/null
git commit -m "html5-boilerplate setup complete" >> /dev/null
echo " "$DONE
# Give a completion message
echo ""
echo " Setup complete! "
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment