lib/convox_installer/config.rb in convox_installer-1.0.5 vs lib/convox_installer/config.rb in convox_installer-1.0.6
- old
+ new
@@ -6,11 +6,11 @@
require "securerandom"
module ConvoxInstaller
class Config
CONFIG_FILE = File.expand_path("./.installer_config").freeze
-
+
attr_accessor :logger, :config, :prompts, :highline
DEFAULT_PROMPTS = [
{
key: :stack_name,
@@ -127,11 +127,11 @@
# (e.g. securely generated passwords)
if prompt[:value]
return if config[key]
default = prompt[:value]
- config[key] = default.is_a?(Proc) ? default.call : default
+ config[key] = default.is_a?(Proc) ? default.call(config) : default
save_config_to_file
return
end
prompt_string = prompt[:prompt] || "Please enter your #{title}: "
@@ -167,12 +167,12 @@
config[key] = value
end
end
def save_config_to_file
- FileUtils.mkdir_p File.expand_path("~/.convox")
+ # FileUtils.mkdir_p File.expand_path("~/.convox")
File.open(CONFIG_FILE, "w") do |f|
- f.puts({config: config}.to_json)
+ f.puts({ config: config }.to_json)
end
end
def self.config_file_exists?
File.exist?(CONFIG_FILE)