diff options
| author | mo khan <mo.khan@gmail.com> | 2020-03-15 11:49:09 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-03-15 11:49:09 -0600 |
| commit | 79cba187692c9964dd7a3b97c323768566347f40 (patch) | |
| tree | 06cad01b3c0c96b47ed1e10ee4f4a30da9467910 /rvh/bin | |
| parent | adb80a2e88cc508357fe6da6c6898d5e97d531d2 (diff) | |
Add rails application
Diffstat (limited to 'rvh/bin')
| -rwxr-xr-x | rvh/bin/rails | 4 | ||||
| -rwxr-xr-x | rvh/bin/setup | 13 |
2 files changed, 17 insertions, 0 deletions
diff --git a/rvh/bin/rails b/rvh/bin/rails new file mode 100755 index 0000000..0739660 --- /dev/null +++ b/rvh/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path('../config/application', __dir__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/rvh/bin/setup b/rvh/bin/setup new file mode 100755 index 0000000..7606fd6 --- /dev/null +++ b/rvh/bin/setup @@ -0,0 +1,13 @@ +#!/usr/bin/env ruby + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +Dir.chdir File.expand_path('..', __dir__) do + system! 'bundle install' + system! 'cp config/database.yml.sample config/database.yml' unless File.exist?('config/database.yml') + system! 'bin/rails db:prepare' + system! 'bin/rails log:clear tmp:clear' + system! 'bin/rails restart' +end |
