From 6c51f293722c6018173317fb63e3369bb2539917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Fri, 28 Jan 2022 18:45:05 +0100 Subject: [PATCH] Rakefile: minor, show error on empty BOM --- Rakefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Rakefile b/Rakefile index 52f4771..727c781 100644 --- a/Rakefile +++ b/Rakefile @@ -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|