Mercurial > rsstweet
comparison bin/setup @ 255:eda83610b65c
Update rails and stuff
author | nanaya <me@nanaya.net> |
---|---|
date | Sun, 15 Dec 2024 22:45:33 +0900 |
parents | 89f6c0016bab |
children |
comparison
equal
deleted
inserted
replaced
254:89f6c0016bab | 255:eda83610b65c |
---|---|
1 #!/usr/bin/env ruby | 1 #!/usr/bin/env ruby |
2 require "fileutils" | 2 require "fileutils" |
3 | 3 |
4 APP_ROOT = File.expand_path("..", __dir__) | 4 APP_ROOT = File.expand_path("..", __dir__) |
5 APP_NAME = "rsstweet" | |
6 | 5 |
7 def system!(*args) | 6 def system!(*args) |
8 system(*args, exception: true) | 7 system(*args, exception: true) |
9 end | 8 end |
10 | 9 |
12 # This script is a way to set up or update your development environment automatically. | 11 # 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. | 12 # This script is idempotent, so that you can run it at any time and get an expectable outcome. |
14 # Add necessary setup steps to this file. | 13 # Add necessary setup steps to this file. |
15 | 14 |
16 puts "== Installing dependencies ==" | 15 puts "== Installing dependencies ==" |
17 system! "gem install bundler --conservative" | |
18 system("bundle check") || system!("bundle install") | 16 system("bundle check") || system!("bundle install") |
19 | 17 |
20 puts "\n== Removing old logs and tempfiles ==" | 18 puts "\n== Removing old logs and tempfiles ==" |
21 system! "bin/rails log:clear tmp:clear" | 19 system! "bin/rails log:clear tmp:clear" |
22 | 20 |
23 puts "\n== Restarting application server ==" | 21 unless ARGV.include?("--skip-server") |
24 system! "bin/rails restart" | 22 puts "\n== Starting development server ==" |
25 | 23 STDOUT.flush # flush the output before exec(2) so that it displays |
26 # puts "\n== Configuring puma-dev ==" | 24 exec "bin/dev" |
27 # system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}" | 25 end |
28 # system "curl -Is https://#{APP_NAME}.test/up | head -n 1" | |
29 end | 26 end |