lib/wukong/script/local_command.rb in wukong-2.0.0 vs lib/wukong/script/local_command.rb in wukong-2.0.1

- old
+ new

@@ -23,10 +23,16 @@ # def local_commandline @input_paths = input_paths.map(&:strip).join(' ') cmd_input_str = (input_paths == '-') ? "" : "cat '#{input_paths}' | " cmd_output_str = (output_path == '-') ? "" : "> '#{output_path}'" - %Q{ #{cmd_input_str} #{mapper_commandline} | #{local_mode_sort_commandline} | #{reducer_commandline} #{cmd_output_str} } + + if (reducer || options[:reduce_command]) + %Q{ #{cmd_input_str} #{mapper_commandline} | #{local_mode_sort_commandline} | #{reducer_commandline} #{cmd_output_str} } + else + %Q{ #{cmd_input_str} #{mapper_commandline} | #{local_mode_sort_commandline} #{cmd_output_str} } + end + end end end