Files
fizzy/bin/setup
T
Mike Dalessio 6a9b98e44f Remove the mysql setup
no longer needed now that we're not connecting to 37id
2025-10-03 21:56:18 -04:00

27 lines
784 B
Ruby
Executable File

#!/usr/bin/env ruby
require "mkmf"
def system!(*args) system(*args, exception: true) end
puts "\n== Installing Ruby and Node =="
system("mise install -y")
puts "\n== Installing dependencies =="
if MakeMakefile.find_executable0("pacman")
packages = "imagemagick openslide"
system("pacman -Q #{packages} || sudo pacman -S --noconfirm --needed #{packages}")
end
system("gem install bundler --conservative")
system("bundle config set --local auto_install true")
system("bundle check") || system!("bundle install")
puts "\n== Preparing database =="
if ARGV.include?("--reset")
system! "bin/rails db:drop db:create db:schema:load db:prepare db:seed"
else
system! "bin/rails db:prepare"
end
puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"