Rakefile: minor, show error on empty BOM

This commit is contained in:
King Kévin 2022-01-28 18:45:05 +01:00
parent d21265f083
commit 6c51f29372
1 changed files with 4 additions and 0 deletions

View File

@ -165,6 +165,10 @@ def bom2(schematic, attributes)
list.gsub!(/(?!http):(?!\/\/)/, '\1":"\2') # protect the values between ':' (such as URLs)
# parse bom2
csv = CSV.parse(list, col_sep: ":", quote_char: '"')
if csv.empty? then
$stderr.puts "no parts found for BOM"
return []
end
csv[1..-1].each do |row|
line = {}
row.each_index do |col|