Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MattSturgeon committed Sep 20, 2023
1 parent 9cf1875 commit 88c02f1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/draw-keymaps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,37 @@ jobs:
- name: Parse
run: |
# TODO set generic vars in one place globally
KEYBOARD="${{ env.keymap }}"
KEYBOARD="${{ env.keyboard }}"
KEYMAP="config/${KEYBOARD}.keymap"
CONFIG="${{ env.km_dr_config }}"
OUTPUT="${{ env.output_folder }}/${KEYBOARD}.yaml"
keymap -c "$CONFIG" parse -z "$KEYMAP" > "$OUTPUT"
- name: Draw keymap
run: |
KEYBOARD="${{ env.keymap }}"
KEYMAP="${KEYBOARD}.yaml"
KEYBOARD="${{ env.keyboard }}"
KEYMAP="config/${KEYBOARD}.keymap"
CONFIG="${{ env.km_dr_config }}"
OUTPUT="${{ env.output_folder }}/${KEYBOARD}.svg"
keymap -c "$CONFIG" draw "$KEYMAP" > "$OUTPUT"
- name: Draw layer keymap
run: |
# Ensure errors propagate when piping stdout
set -o pipefail
KEYBOARD="${{ env.keymap }}"
KEYMAP="${KEYBOARD}.yaml"
KEYBOARD="${{ env.keyboard }}"
KEYMAP="config/${KEYBOARD}.keymap"
CONFIG="${{ env.km_dr_config }}"
# Function to draw the given layer's keymap
draw() {
LAYER="$1"
OUTPUT="${{ env.output_folder }}/${KEYBOARD}_${LAYER}.yaml"
keymap -c "$CONFIG" draw "$KEYMAP" -s "$LAYER" > "$OUTPUT"
}
# Run `draw()` for each layer in the keymap. Up to 4 layers at a time...
python3 .github/workflows/layers.py "$KEYMAP" \
| parallel --jobs 4 draw
Expand Down

0 comments on commit 88c02f1

Please sign in to comment.