mirror of
https://github.com/pierrechevalier83/ferris.git
synced 2024-11-28 07:23:44 +03:00
db4b83b05a
Use the dockerised version of kicad-automation-scripts from dockerhub to reliably check ERC without many constraints on the host machine.
18 lines
600 B
Bash
Executable File
18 lines
600 B
Bash
Executable File
ERC_OUTPUT=$(docker run --rm -t -v "$(pwd)"/$1:/kicad-project productize/kicad-automation-scripts python -m kicad-automation.eeschema.schematic run_erc /kicad-project/ferris.sch "$(pwd)"/build | grep "DEBUG:root:Last line" | sed "s/DEBUG:root:Last line: //")
|
|
|
|
if [[ -z "$ERC_OUTPUT" ]]; then
|
|
echo -e "\e[1;32mERROR\e[0m"
|
|
echo "Missing ERC report line. Something went wrong"
|
|
exit 2
|
|
else
|
|
if [[ "$ERC_OUTPUT" = *"ERC messages: 0 Errors 0 Warnings 0"* ]]; then
|
|
echo -e "\e[1;32mPASS\e[0m"
|
|
echo "$ERC_OUTPUT"
|
|
exit 0
|
|
else
|
|
echo -e "\e[1;32mFAIL\e[0m"
|
|
echo "$ERC_OUTPUT"
|
|
exit 1
|
|
fi
|
|
fi
|