diff --git a/lib/tasks/bootstrap.rake b/lib/tasks/bootstrap.rake index a1de1a5f..8fced818 100644 --- a/lib/tasks/bootstrap.rake +++ b/lib/tasks/bootstrap.rake @@ -195,8 +195,8 @@ namespace :bootstrap do u = User.new(username: "root", email: "root@localhost.local") # Ask for password/password_confirmation and hide the characters - password = nil - password_confirmation = nil + password = ENV['ROOTPASS'] + password_confirmation = ENV['ROOTPASS'] console = HighLine.new until password.present? && password == password_confirmation password = console.ask("Enter your password: ") { |q| q.echo = false } @@ -215,11 +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\"" - print "Hostname: " - hostname = STDIN.gets.chomp + + 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 }