Skip to content
Snippets Groups Projects
Commit dead6f12 authored by Krisjanis Rijnieks's avatar Krisjanis Rijnieks :lion_face:
Browse files

Use library location from outside the inventory test script

parent 2b440e3b
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,21 @@ ...@@ -5,6 +5,21 @@
# TODO: Create whitelist (some parts from DigiKey are not electronics parts) # TODO: Create whitelist (some parts from DigiKey are not electronics parts)
# The location of the library can change. Supply it from outside.
if [[ ! ${1} ]]; then
echo "Please specify KiCad library file."
echo "Usage: ./inventory.sh ../fab.kicad_sym"
exit 1
fi
# Check if file exists
if [[ ! -f ${1} ]]; then
echo "Library file does not exist."
echo "Make sure the path to the library file is correct."
exit 1
fi
LIBRARY_FILE=${1}
INVENTORY_URL="http://inventory.fabcloud.io/data/inv.json" INVENTORY_URL="http://inventory.fabcloud.io/data/inv.json"
SOURCE="Digi-Key" SOURCE="Digi-Key"
...@@ -19,7 +34,7 @@ ERRORS=0 ...@@ -19,7 +34,7 @@ ERRORS=0
echo "This script looks for parts that are not in the KiCad fab library yet. In order to add parts, make sure that the manufacturer number of the part is added to the keywords section of the library symbol." echo "This script looks for parts that are not in the KiCad fab library yet. In order to add parts, make sure that the manufacturer number of the part is added to the keywords section of the library symbol."
# Read keywords from all KiCad fab library symbols # Read keywords from all KiCad fab library symbols
KEYWORD_LINES=$(cat ../fab.kicad_sym | grep --extended-regexp --only-matching -U 'property "ki_keywords" "([^"]*)"') KEYWORD_LINES=$(cat ${LIBRARY_FILE} | grep --extended-regexp --only-matching -U 'property "ki_keywords" "([^"]*)"')
KEYWORDS="" KEYWORDS=""
IFS=$'\n' IFS=$'\n'
for LINE in ${KEYWORD_LINES}; do for LINE in ${KEYWORD_LINES}; do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment