exe/caravan in caravan-0.6.2 vs exe/caravan in caravan-0.7.0

- old
+ new

@@ -8,10 +8,14 @@ options = {} option_parser = OptionParser.new do |opts| opts.banner = "Caravan #{Caravan::VERSION}\nCopyright (c) David Zhang 2018\n" opts.separator "" + opts.on("-l YAML_NAME", "--load YAML_NAME", "YAML path") do |value| + options[:yaml] = value + end + opts.on("-s SOURCE_PATH", "--source SOURCE_PATH", "Source path") do |value| options[:src] = value end opts.on("-d DEST_PATH", "--dest DEST_PATH", "Destination path") do |value| @@ -28,16 +32,14 @@ else options[:ignore] = [value] end end - options[:once] = false opts.on("-o", "--once", "Deploy for once") do options[:once] = true end - options[:debug] = false opts.on("-b", "--debug", "Debug mode") do options[:debug] = true end opts.on_head("--init", "Init caravan.yml") do @@ -54,10 +56,14 @@ if ARGV.length == 0 merged_conf = Caravan::Config.merge({}, Caravan.process_conf(".")) else option_parser.parse!(ARGV) - merged_conf = Caravan::Config.merge(options, Caravan.process_conf(options[:src])) + if options.key?(:yaml) + merged_conf = Caravan::Config.merge(options, Caravan.process_conf(options[:src], options[:yaml])) + else + merged_conf = Caravan::Config.merge(options, Caravan.process_conf(options[:src])) + end end if merged_conf.key?("src") && merged_conf.key?("dst") && merged_conf.key?("deploy_mode") Caravan.start(merged_conf) else