bin/setup
#!/usr/bin/env ruby
require "fileutils"
# path to dummy application root.
APP_ROOT = File.expand_path("../spec/dummy", __dir__)
# path to alchemy gem
GEM_ROOT = File.expand_path("../", __dir__)
def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
FileUtils.chdir GEM_ROOT do
system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install")
end
FileUtils.chdir APP_ROOT do
puts "\n== Installing Alchemy into dummy app =="
system!("bin/rails g alchemy:install --skip --skip-demo-files --auto-accept")
puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"
end
puts "\n== Alchemy is ready 🎉 =="
puts "Start server by typing:\n\n bin/start"