lib/ruby_terraform/commands/init.rb in ruby-terraform-0.65.0.pre.2 vs lib/ruby_terraform/commands/init.rb in ruby-terraform-0.65.0.pre.3

- old
+ new

@@ -12,24 +12,31 @@ path = opts[:path] plugin_dir = opts[:plugin_dir] force_copy = opts[:force_copy] builder = builder - .with_subcommand('init') do |sub| - sub = sub.with_option('-backend', backend) unless backend.nil? - sub = sub.with_option('-force-copy', force_copy) unless force_copy.nil? - sub = sub.with_option('-get', get) unless get.nil? - sub = sub.with_option('-from-module', source) if source - sub = sub.with_flag('-no-color') if no_color - sub = sub.with_option('-plugin-dir', plugin_dir) unless plugin_dir.nil? - backend_config.each do |key, value| - sub = sub.with_option( - '-backend-config', - "'#{key}=#{value}'", - separator: ' ') - end - sub - end + .with_subcommand('init') do |sub| + sub = sub.with_option('-backend', backend) unless backend.nil? + unless force_copy.nil? + sub = sub.with_option('-force-copy', + force_copy) + end + sub = sub.with_option('-get', get) unless get.nil? + sub = sub.with_option('-from-module', source) if source + sub = sub.with_flag('-no-color') if no_color + unless plugin_dir.nil? + sub = sub.with_option('-plugin-dir', + plugin_dir) + end + backend_config.each do |key, value| + sub = sub.with_option( + '-backend-config', + "'#{key}=#{value}'", + separator: ' ' + ) + end + sub + end builder = builder.with_argument(path) if path builder end