Skip to content

Instantly share code, notes, and snippets.

@leonelgalan
Last active December 14, 2015 19:29
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 leonelgalan/5137209 to your computer and use it in GitHub Desktop.
Save leonelgalan/5137209 to your computer and use it in GitHub Desktop.
Downloads my sinatra_base repository and renames it to the desired name. Usage: `curl https://raw.github.com/gist/5137209 | bash -s project_name`
#!/bin/bash
wget https://github.com/leonelgalan/sinatra_base/archive/master.zip
unzip master.zip
rm master.zip
mv sinatra_base-master $1
LAST_RUBY=`curl 'http://ftp.ruby-lang.org/pub/ruby/1.9/' 2> /dev/null | ruby -e 'puts STDIN.lines.map { |x| /1\.9\.3-p\d+\b/.match(x) }.compact.last[0]'`
echo $LAST_RUBY > $1/.ruby-version
echo $1 > $1/.ruby-gemset
unset LAST_RUBY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment