summaryrefslogtreecommitdiff
path: root/pcb/print-bom.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pcb/print-bom.sh')
-rwxr-xr-xpcb/print-bom.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/pcb/print-bom.sh b/pcb/print-bom.sh
new file mode 100755
index 0000000..27546b0
--- /dev/null
+++ b/pcb/print-bom.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+
+set -euf
+
+
+SCRIPT_PATH="$0"
+PCB_PATH="$(dirname "${SCRIPT_PATH}")"
+INPUT_PATH="${PCB_PATH}/soundbox.kicad_sch"
+OUTPUT_PATH="$(mktemp -t --suffix '.csv' kicad-bom-XXXX)"
+
+FIELDS='Reference,Description,Value,Manufacturer,MPN,Datasheet'
+
+
+kicad-cli sch export bom \
+ -o "$OUTPUT_PATH" \
+ --fields "$FIELDS" \
+ "$INPUT_PATH"
+
+cat "$OUTPUT_PATH"
+rm "$OUTPUT_PATH"