Last active
June 29, 2016 13:39
-
-
Save etagwerker/956448c7a4b058b45e23f562deca8d79 to your computer and use it in GitHub Desktop.
bin/setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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