-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexport.sh
executable file
·83 lines (62 loc) · 2.35 KB
/
export.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
set -e
function handleDir {
USER_ID=$(id -u)
GROUP_ID=$(id -g)
WORKDIR=.
SUBDIR=$1
echo "Handling ${SUBDIR}"
cp kibot_generated.kibot.yaml $SUBDIR
docker run --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY \
-v $(pwd)/$WORKDIR:/home/$USER/workdir \
--user $USER_ID:$GROUP_ID \
--env NO_AT_BRIDGE=1 \
--workdir="/home/$USER" \
--volume="/home/$USER/.local/share/kicad:/home/$USER/.local/share/kicad" \
--volume="/home/$USER/.cache/kicad_v6.0:/home/$USER/.cache/kicad_v6.0" \
--volume="/home/$USER/.cache/kicad:/home/$USER/.cache/kicad" \
--volume="/home/$USER/.cache/kicost:/home/$USER/.cache/kicost" \
--volume="/home/$USER/.config/kicad:/home/$USER/.config/kicad:rw" \
--volume="/etc/group:/etc/group:ro" \
--volume="/etc/passwd:/etc/passwd:ro" \
--volume="/etc/shadow:/etc/shadow:ro" \
ghcr.io/inti-cmnb/kicad8_auto:1.8.1 /bin/bash -c "cd workdir/$SUBDIR; kibot"
rm ${WORKDIR}/${SUBDIR}/kibot_generated.kibot.yaml
# The generated SVG has a date timestamp in its title, let's get rid of that so we don't create a diff each time.
sed -E -i 's/svg date [0-9 /:]+/svg/g' ${SUBDIR}/export/Schematic/*.svg
}
if [ $# -eq 1 ]; then
handleDir $1
exit
fi
# Can't do this in parallel, since there's contention on files in ~/.config/kicad
handleDir QuadAttenuverter/ioboard
handleDir QuadAttenuverter/mainboard
handleDir QuadAttenuverter/faceplate
handleDir DualMixer/ioboard
handleDir DualMixer/mainboard
handleDir DualMixer/faceplate
handleDir RayWilson-Dual-VCA/mainboard
handleDir RayWilson-Dual-VCA/ioboard
handleDir RayWilson-Dual-VCA/faceplate
handleDir SCM-140-ADSR/faceplate_kicad
handleDir SCM-140-ADSR/ioboard
handleDir SCM-140-ADSR/mainboard
handleDir TH-555-VCO/faceplate-kicad
handleDir TH-555-VCO/ioboard
handleDir TH-555-VCO/mainboard
handleDir OrnamentCrime/faceplate
handleDir Steiner-VCF/faceplate
handleDir Steiner-VCF/ioboard
handleDir Steiner-VCF/mainboard
handleDir TuringMachine/TuringBack
handleDir TuringMachine/TuringFront
handleDir adapter-soic16
handleDir power-board
handleDir AS3340-VCO/mainboard
handleDir AS3340-VCO/ioboard
handleDir AS3340-VCO/faceplate
handleDir DuinoRack/mainboard
handleDir DuinoRack/ioboard
handleDir DuinoRack/faceplate
wait