mirror of
https://github.com/System-End/stickers.git
synced 2026-04-19 19:45:14 +00:00
27 lines
673 B
Ruby
Executable file
27 lines
673 B
Ruby
Executable file
#!/usr/bin/env ruby
|
|
require "fileutils"
|
|
|
|
APP_ROOT = File.expand_path("..", __dir__)
|
|
|
|
def system!(*args)
|
|
system(*args, exception: true)
|
|
end
|
|
|
|
FileUtils.chdir APP_ROOT do
|
|
|
|
puts "== Installing dependencies =="
|
|
system("bundle check") || system!("bundle install")
|
|
|
|
puts "\n== Preparing database =="
|
|
system! "bin/rails db:prepare"
|
|
system! "bin/rails db:reset" if ARGV.include?("--reset")
|
|
|
|
puts "\n== Removing old logs and tempfiles =="
|
|
system! "bin/rails log:clear tmp:clear"
|
|
|
|
unless ARGV.include?("--skip-server")
|
|
puts "\n== Starting development server =="
|
|
STDOUT.flush # flush the output before exec(2) so that it displays
|
|
exec "bin/dev"
|
|
end
|
|
end
|