Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve bin/setup by indicating application.yml needs adjusting #1300

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading