Skip to content

Commit

Permalink
Merge pull request ManageIQ#12100 from jrafanie/warn_on_missing_cable…
Browse files Browse the repository at this point in the history
…_yml

In dev, warn and exit if cable.yml and db yml are missing
  • Loading branch information
himdel authored Oct 22, 2016
2 parents 210b52d + 6851c70 commit 743893b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bin/update
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,18 @@ def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end

def dev_warn_and_exit_if_missing(file, sample)
if ENV.fetch('RAILS_ENV', 'development') == 'development' && !File.exist?(file)
warn "Your #{file} is missing, please run 'cp #{sample} #{file}' and try again."
exit 1
end
end

chdir APP_ROOT do
# This script is a way to update your development environment automatically.
# Add necessary update steps to this file.
dev_warn_and_exit_if_missing('config/cable.yml', 'config/cable.yml.sample')
dev_warn_and_exit_if_missing('config/database.yml', 'config/database.pg.yml')

puts '== Installing dependencies =='
# Run bower in a thread and continue to do the non-js stuff
Expand Down

0 comments on commit 743893b

Please sign in to comment.