about summary refs log tree commit diff stats
path: root/bin/setup
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2022-12-10 12:32:44 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2022-12-10 12:32:44 -0500
commit230ab3079fd4e16ebaa593f6cc5fdbcbad3c2321 (patch)
treeb61b7d4c706de43361da73cce0d2a2a006a89b18 /bin/setup
parentdc7253d0b71f25c2e9a4547d414fa18390b74fbf (diff)
downloadthoughts-230ab3079fd4e16ebaa593f6cc5fdbcbad3c2321.tar.gz
thoughts-230ab3079fd4e16ebaa593f6cc5fdbcbad3c2321.tar.bz2
thoughts-230ab3079fd4e16ebaa593f6cc5fdbcbad3c2321.zip
Installed LINGO scoreboard
Diffstat (limited to 'bin/setup')
-rwxr-xr-xbin/setup31
1 files changed, 13 insertions, 18 deletions
diff --git a/bin/setup b/bin/setup index 78c4e86..ec47b79 100755 --- a/bin/setup +++ b/bin/setup
@@ -1,38 +1,33 @@
1#!/usr/bin/env ruby 1#!/usr/bin/env ruby
2require 'pathname' 2require "fileutils"
3require 'fileutils'
4include FileUtils
5 3
6# path to your application root. 4# path to your application root.
7APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) 5APP_ROOT = File.expand_path("..", __dir__)
8 6
9def system!(*args) 7def system!(*args)
10 system(*args) || abort("\n== Command #{args} failed ==") 8 system(*args) || abort("\n== Command #{args} failed ==")
11end 9end
12 10
13chdir APP_ROOT do 11FileUtils.chdir APP_ROOT do
14 # This script is a starting point to setup your application. 12 # This script is a way to set up or update your development environment automatically.
13 # This script is idempotent, so that you can run it at any time and get an expectable outcome.
15 # Add necessary setup steps to this file. 14 # Add necessary setup steps to this file.
16 15
17 puts '== Installing dependencies ==' 16 puts "== Installing dependencies =="
18 system! 'gem install bundler --conservative' 17 system! "gem install bundler --conservative"
19 system('bundle check') || system!('bundle install') 18 system("bundle check") || system!("bundle install")
20
21 # Install JavaScript dependencies if using Yarn
22 # system('bin/yarn')
23
24 19
25 # puts "\n== Copying sample files ==" 20 # puts "\n== Copying sample files =="
26 # unless File.exist?('config/database.yml') 21 # unless File.exist?("config/database.yml")
27 # cp 'config/database.yml.sample', 'config/database.yml' 22 # FileUtils.cp "config/database.yml.sample", "config/database.yml"
28 # end 23 # end
29 24
30 puts "\n== Preparing database ==" 25 puts "\n== Preparing database =="
31 system! 'bin/rails db:setup' 26 system! "bin/rails db:prepare"
32 27
33 puts "\n== Removing old logs and tempfiles ==" 28 puts "\n== Removing old logs and tempfiles =="
34 system! 'bin/rails log:clear tmp:clear' 29 system! "bin/rails log:clear tmp:clear"
35 30
36 puts "\n== Restarting application server ==" 31 puts "\n== Restarting application server =="
37 system! 'bin/rails restart' 32 system! "bin/rails restart"
38end 33end