Skip to content

Commit

Permalink
Cleaning up bootstrap hostname assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
rickychilcott committed Dec 28, 2017
1 parent 888523f commit a859102
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/tasks/bootstrap.rake
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,14 @@ namespace :bootstrap do
desc "Create a settings.yaml file, if missing"
task :settings, [:settings, :hostname] => :environment do |_t, args|
unless File.exist?("config/settings.yaml")
hostname = args.hostame
puts "Grenerating settings.yaml file, if blank default to \"localhost:3000\""
hostname = ENV['HOSTNAME']
print "Hostname: " if hostname.empty?

hostname = args.hostname if hostname.empty?
hostname = ENV['HOSTNAME'] if hostname.empty?
hostname = STDIN.gets.chomp if hostname.empty?
hostname = "localhost:3000" if hostname.empty?
print "Hostname: #{hostname}"

h = {}
File.open("config/settings.yaml", "w") do |file|
h[:action_mailer] = { host: hostname.to_s }
Expand Down

0 comments on commit a859102

Please sign in to comment.