Skip to content
Snippets Groups Projects

CLI: Assume definitions supply keys in the dirname instead of filename

Merged Jorn van de Beek requested to merge jb_fix_cli into main
2 files
+ 3
4
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 2
3
@@ -21,7 +21,7 @@ OptionParser.new do |opts|
end
opts.on("--seeds=INPUT") do |value|
seeds_path = value
puts '--seeds is a deprecated option, questionnaire definitions should use seed_patches to conserve seed tweaks'
end
end.parse!
@@ -38,7 +38,7 @@ lookup_tables = Quby::Compiler::Entities::LookupTables.new(lookup_tables_path)
paths.each do |path|
puts "Compiling #{path}"
key = File.basename(path, File.extname(path))
key = File.basename(File.dirname(path))
sourcecode = File.read(path)
last_update = File.mtime(path)
seed_path = File.join(seeds_path, "#{key}.yml")
@@ -46,7 +46,6 @@ paths.each do |path|
compiled = Quby::Compiler.compile(key, sourcecode, path: path, seeds: seeds, lookup_tables: lookup_tables, last_update: last_update)
FileUtils.mkdir_p(File.join(output_path, key))
compiled[:outputs].each do |type, output|
next unless output
File.open(File.join(output_path, key, output.filename), 'w') do |file|
Loading