Skip to content

Commit

Permalink
Add some clearer indication of setting up application.yml in bin/setup
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinthinks committed Dec 25, 2024
1 parent 3b5823a commit 77d96e8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ group :development, :test, :staging do
end

group :development, :test do
gem "colorize"
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[mri mingw x64_mingw]
gem "pry", "~> 0.15.0"
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ GEM
childprocess (5.1.0)
logger (~> 1.5)
coderay (1.1.3)
colorize (1.1.0)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
crass (1.0.6)
Expand Down Expand Up @@ -583,6 +584,7 @@ DEPENDENCIES
brakeman
bugsnag (~> 6.27)
capybara
colorize
cuprite
dartsass-rails
debug
Expand Down
11 changes: 8 additions & 3 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env ruby
require "fileutils"
require "colorize"

APP_ROOT = File.expand_path("..", __dir__)

Expand All @@ -16,9 +17,13 @@ FileUtils.chdir APP_ROOT do
system("bundle check") || system!("bundle install")

# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
# end
unless File.exist?("config/application.yml")
puts "== Setup application.yml =="
puts "⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️"
puts "Please provide the necessary configuration in config/application.yml".colorize(:red)
puts "⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️"
FileUtils.cp "config/application.example.yml", "config/application.yml"
end

puts "\n== Preparing database =="
system! "bin/rails db:prepare"
Expand Down

0 comments on commit 77d96e8

Please sign in to comment.