Skip to content

Instantly share code, notes, and snippets.

@etagwerker
Last active June 29, 2016 13:39
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 etagwerker/956448c7a4b058b45e23f562deca8d79 to your computer and use it in GitHub Desktop.
Save etagwerker/956448c7a4b058b45e23f562deca8d79 to your computer and use it in GitHub Desktop.
bin/setup
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'
include FileUtils
# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file:
puts "== Setting up your .env file =="
if File.exists? ".env"
puts "== Skipped (.env present)"
else
system "cp .env.sample .env"
end
puts "== Installing dependencies =="
system "gem install bundler --conservative"
system "bundle check || bundle install"
puts "\n== Preparing database =="
system "bin/rake db:setup"
puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*"
system "rm -rf tmp/cache"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment