Git pre-commit hook to generate .png from .brd/sch

parent db2ad00f
Pipeline #549 passed with stage
in 26 seconds
#!/bin/bash
cd "$( dirname "${BASH_SOURCE[0]}" )"
pwd
cd ../..
pwd
GIT="git"
function check {
echo checking $1
status=$($GIT status --porcelain | awk '/^M/' | grep $1)
[ "$status" ]
return $?
}
function brd {
if check $1
then
eagle -C "set confirm yes;
display None;
display Top Bottom Pads Vias Unrouted Dimension tPlace bPlace tName bNames Measures Document tDocu bDocu;
ratsnest;
export image $1.png 300;
set confirm no;
quit;" $1
$GIT add $1.png
fi
}
function sch {
if check $1
then
eagle -C "set confirm yes;
export image $1.png 300;
set confirm no;
quit;" $1
$GIT add $1.png
# eagle -C "set confirm yes;
# print -1 -mirror -caption -rotate -upsidedown landscape paper A4 file $1-%N.pdf;
# set confirm no;
# quit;" $1
# $GIT add $1-*.pdf
fi
}
brd "HW/DevBoard/DevBoard.brd"
sch "HW/DevBoard/DevBoard.sch"
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE eagle SYSTEM "eagle.dtd">
<eagle version="6.6.0">
<eagle version="7.2.0">
<drawing>
<settings>
<setting alwaysvectorfont="no"/>
......@@ -3952,6 +3952,9 @@ design rules under a new name.</description>
<autorouter>
<pass name="Default">
<param name="RoutingGrid" value="50mil"/>
<param name="AutoGrid" value="1"/>
<param name="Efforts" value="0"/>
<param name="TopRouterVariant" value="1"/>
<param name="tpViaShape" value="round"/>
<param name="PrefDir.1" value="|"/>
<param name="PrefDir.2" value="0"/>
......@@ -4886,7 +4889,7 @@ design rules under a new name.</description>
<via x="86.0425" y="50.8" extent="1-16" drill="0.6"/>
<via x="95.25" y="48.895" extent="1-16" drill="0.6"/>
<via x="88.9" y="38.4175" extent="1-16" drill="0.6"/>
<via x="114.935" y="52.705" extent="1-16" drill="0.6"/>
<via x="114.6175" y="52.705" extent="1-16" drill="0.6"/>
<via x="16.51" y="64.77" extent="1-16" drill="0.6"/>
<via x="57.4675" y="90.4875" extent="1-16" drill="0.6"/>
<via x="55.88" y="82.55" extent="1-16" drill="0.6"/>
......@@ -4922,7 +4925,7 @@ design rules under a new name.</description>
<via x="93.98" y="14.2875" extent="1-16" drill="0.6"/>
<via x="98.1075" y="19.3675" extent="1-16" drill="0.6"/>
<via x="102.87" y="13.335" extent="1-16" drill="0.6"/>
<via x="120.3325" y="6.985" extent="1-16" drill="0.6"/>
<via x="120.3325" y="6.6675" extent="1-16" drill="0.6"/>
<via x="110.49" y="33.655" extent="1-16" drill="0.6"/>
<via x="104.4575" y="34.6075" extent="1-16" drill="0.6"/>
<via x="109.855" y="13.335" extent="1-16" drill="0.6"/>
......
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE eagle SYSTEM "eagle.dtd">
<eagle version="6.6.0">
<eagle version="7.2.0">
<drawing>
<settings>
<setting alwaysvectorfont="no"/>
#!/bin/bash
cd "$( dirname "${BASH_SOURCE[0]}" )"
rm -rf .git/hooks
pwd
ln -s $(pwd)/.hooks .git/hooks
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment