diff --git a/lib/bookbinder/dita_command_creator.rb b/lib/bookbinder/dita_command_creator.rb index f98bf203b..f45bc264b 100644 --- a/lib/bookbinder/dita_command_creator.rb +++ b/lib/bookbinder/dita_command_creator.rb @@ -34,12 +34,19 @@ def unduplicated_flags(write_to: nil, ditamap_path: nil, ditaval_path: nil, dita arg_flags = { 'output.dir' => write_to, 'args.input' => ditamap_path, - 'args.filter' => ditaval_path || "" - } + }.merge(filter(ditaval_path)) all_flags = arg_flags.merge(base_flags.merge(optional_flags dita_flags)) format(all_flags) end + def filter(ditaval_path) + if ditaval_path + { 'args.filter' => ditaval_path } + else + {} + end + end + def base_flags { 'basedir' => '/', diff --git a/spec/lib/bookbinder/dita_command_creator_spec.rb b/spec/lib/bookbinder/dita_command_creator_spec.rb index f886fcb28..90b5c94f8 100644 --- a/spec/lib/bookbinder/dita_command_creator_spec.rb +++ b/spec/lib/bookbinder/dita_command_creator_spec.rb @@ -115,7 +115,6 @@ module Bookbinder 'ant -f /path/to/dita/ot ' + "-Doutput.dir='/path/to/processed/dita/boo' " + "-Dargs.input='/local/path/to/repo/path/to/map.ditamap' " + - "-Dargs.filter='' " + "-Dbasedir='/' " + "-Dtranstype='tocjs' " + "-Ddita.temp.dir='hey/some/new/dir' " + @@ -144,7 +143,6 @@ module Bookbinder 'ant -f /path/to/dita/ot ' + "-Doutput.dir='/path/to/processed/dita/boo' " + "-Dargs.input='/local/path/to/repo/path/to/map.ditamap' " + - "-Dargs.filter='' " + "-Dbasedir='/' " + "-Dtranstype='tocjs' " + "-Ddita.temp.dir='/tmp/bookbinder_dita' " +