-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·24 lines (19 loc) · 933 Bytes
/
entrypoint.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
#!/bin/bash
output="/github/workspace/$2"
input="/github/workspace/$1"
drill_format="${3:-excellon}"
drill_units="${4:-mm}"
position_format="${5:-ascii}"
position_units="${6:-in}"
filename="$(basename -- "$input" .${input##*.})"
mkdir -p "$output"
kicad-cli pcb export gerbers -o "$output" "$input"
if [[ "$drill_format" == "excellon" || "$drill_format" == "gerber" ]]; then
kicad-cli pcb export drill --format "$drill_format" --excellon-units "$drill_units" -o "$output" "$input"
fi
if [[ "$position_format" == "ascii" || "$position_format" == "csv" ]]; then
kicad-cli pcb export pos --format "$position_format" --units "$drill_units" -o "$output/$filename.pos" "$input"
elif [[ "$position_format" == "gerber" ]]; then
kicad-cli pcb export pos --format gerber --side front -o "$output/$filename.front.pos" "$input"
kicad-cli pcb export pos --format gerber --side back -o "$output/$filename.back.pos" "$input"
fi