annotate bin/setup @ 257:c6a50441a58d

It's now X
author nanaya <me@nanaya.net>
date Sun, 15 Dec 2024 22:48:25 +0900
parents eda83610b65c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
42
97a6973e9d94 Reset default scripts.
edogawaconan <me@myconan.net>
parents:
diff changeset
1 #!/usr/bin/env ruby
214
2335107f35d0 Run rails update
nanaya <me@nanaya.pro>
parents: 185
diff changeset
2 require "fileutils"
42
97a6973e9d94 Reset default scripts.
edogawaconan <me@myconan.net>
parents:
diff changeset
3
223
ad6264cca788 Update to rails 7
nanaya <me@nanaya.pro>
parents: 214
diff changeset
4 APP_ROOT = File.expand_path("..", __dir__)
42
97a6973e9d94 Reset default scripts.
edogawaconan <me@myconan.net>
parents:
diff changeset
5
72
257910c60eb3 Rails 5 \o/
nanaya <me@myconan.net>
parents: 44
diff changeset
6 def system!(*args)
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
7 system(*args, exception: true)
72
257910c60eb3 Rails 5 \o/
nanaya <me@myconan.net>
parents: 44
diff changeset
8 end
257910c60eb3 Rails 5 \o/
nanaya <me@myconan.net>
parents: 44
diff changeset
9
185
f67f3ad50270 Update to latest rails and gems
nanaya <me@nanaya.pro>
parents: 72
diff changeset
10 FileUtils.chdir APP_ROOT do
214
2335107f35d0 Run rails update
nanaya <me@nanaya.pro>
parents: 185
diff changeset
11 # This script is a way to set up or update your development environment automatically.
2335107f35d0 Run rails update
nanaya <me@nanaya.pro>
parents: 185
diff changeset
12 # This script is idempotent, so that you can run it at any time and get an expectable outcome.
72
257910c60eb3 Rails 5 \o/
nanaya <me@myconan.net>
parents: 44
diff changeset
13 # Add necessary setup steps to this file.
42
97a6973e9d94 Reset default scripts.
edogawaconan <me@myconan.net>
parents:
diff changeset
14
223
ad6264cca788 Update to rails 7
nanaya <me@nanaya.pro>
parents: 214
diff changeset
15 puts "== Installing dependencies =="
ad6264cca788 Update to rails 7
nanaya <me@nanaya.pro>
parents: 214
diff changeset
16 system("bundle check") || system!("bundle install")
42
97a6973e9d94 Reset default scripts.
edogawaconan <me@myconan.net>
parents:
diff changeset
17
97a6973e9d94 Reset default scripts.
edogawaconan <me@myconan.net>
parents:
diff changeset
18 puts "\n== Removing old logs and tempfiles =="
223
ad6264cca788 Update to rails 7
nanaya <me@nanaya.pro>
parents: 214
diff changeset
19 system! "bin/rails log:clear tmp:clear"
42
97a6973e9d94 Reset default scripts.
edogawaconan <me@myconan.net>
parents:
diff changeset
20
255
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
21 unless ARGV.include?("--skip-server")
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
22 puts "\n== Starting development server =="
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
23 STDOUT.flush # flush the output before exec(2) so that it displays
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
24 exec "bin/dev"
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
25 end
42
97a6973e9d94 Reset default scripts.
edogawaconan <me@myconan.net>
parents:
diff changeset
26 end