Skip to content

Commit

Permalink
fix: skip missing files instead of failing
Browse files Browse the repository at this point in the history
  • Loading branch information
gundamu-yunikon committed Jan 1, 2024
1 parent be7fd1f commit b9125ba
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions lib/tasks/bsb_tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,22 @@ namespace :bsb do
file_format: '.txt'
)

require 'bsb/bank_list_generator'
bsb_bl_gen = BSB::BankListGenerator.load_file(bank_list_filename)
File.write('config/bsb_bank_list.json', bsb_bl_gen.json)
raise 'No bank list or bsb found' unless bank_list_filename || db_list_filename

require 'bsb/database_generator'
bsb_db_gen = BSB::DatabaseGenerator.load_file(db_list_filename)
File.write('config/bsb_db.json', bsb_db_gen.json)
if bank_list_filename
require 'bsb/bank_list_generator'
bsb_bl_gen = BSB::BankListGenerator.load_file(bank_list_filename)
File.write('config/bsb_bank_list.json', bsb_bl_gen.json)
else
$stderr.puts 'Missing bank list "KEY TO ABBREVIATIONS AND BSB NUMBERS"'
end

if db_list_filename
require 'bsb/database_generator'
bsb_db_gen = BSB::DatabaseGenerator.load_file(db_list_filename)
File.write('config/bsb_db.json', bsb_db_gen.json)
else
$stderr.puts 'Missing bsb db "BSBDirectory"'
end
end
end

0 comments on commit b9125ba

Please sign in to comment.