lib/metanorma/cli/collection.rb in metanorma-cli-1.7.0 vs lib/metanorma/cli/collection.rb in metanorma-cli-1.7.1.pre
- old
+ new
@@ -33,12 +33,12 @@
def collection_options
@collection_options ||= {
compile: @compile_options,
output_folder: build_output_folder,
- coverpage: options.fetch(:coverpage, nil),
- format: collection_output_formats(options.fetch(:format, "")),
+ coverpage: @options.fetch(:coverpage, nil),
+ format: collection_output_formats(@options.fetch(:format, "")),
}
end
def build_output_folder
output_folder = options.fetch(:output_folder, nil)
@@ -57,16 +57,15 @@
(formats || []).map { |extension| extension.strip.to_sym }
end
def extract_options_from_file
- if options.empty?
yaml_file = YAML.safe_load(File.read(@file.to_s))
@options = Cli.with_indifferent_access(
yaml_file.slice("coverpage", "format", "output_folder"),
)
- end
+ @options.merge!(options)
end
end
end
end