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 fe8b656 commit 0cb4e49
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/draw-keymaps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths:
- "config/*.keymap"
- "config/keymap_drawer.yaml"
- "config/info.json"
env:
km_dr_version: main
km_dr_config: config/keymap_drawer.yaml
Expand Down Expand Up @@ -36,35 +37,32 @@ jobs:
- name: Parse
run: |
# TODO set generic vars in one place globally
KEYBOARD="${{ env.keyboard }}"
KEYMAP="config/${KEYBOARD}.keymap"
KEYMAP="config/${{ env.keyboard }}.keymap"
CONFIG="${{ env.km_dr_config }}"
OUTPUT="${{ env.output_folder }}/${KEYBOARD}.yaml"
OUTPUT="${{ env.output_folder }}/${{ env.keyboard }}.yaml"
keymap -c "$CONFIG" parse -z "$KEYMAP" > "$OUTPUT"
- name: Draw keymap
run: |
KEYBOARD="${{ env.keyboard }}"
KEYMAP="config/${KEYBOARD}.yaml"
KEYMAP="${{ env.output_folder }}/${{ env.keyboard }}.yaml"
INFO="config/info.json"
CONFIG="${{ env.km_dr_config }}"
OUTPUT="${{ env.output_folder }}/${KEYBOARD}.svg"
OUTPUT="${{ env.output_folder }}/${{ env.keyboard }}.svg"
keymap -c "$CONFIG" draw "$KEYMAP" -j "$INFO" > "$OUTPUT"
- name: Draw layer keymap
run: |
# Ensure errors propagate when piping stdout
set -o pipefail
KEYBOARD="${{ env.keyboard }}"
KEYMAP="config/${KEYBOARD}.yaml"
KEYMAP="${{ env.output_folder }}/${{ env.keyboard }}.yaml"
INFO="config/info.json"
CONFIG="${{ env.km_dr_config }}"
# Function to draw the given layer's keymap
draw() {
LAYER="$1"
OUTPUT="${{ env.output_folder }}/${KEYBOARD}_${LAYER}.svg"
OUTPUT="${{ env.output_folder }}/${{ env.keyboard }}_${LAYER}.svg"
keymap -c "$CONFIG" draw "$KEYMAP" -j "$INFO" -s "$LAYER" > "$OUTPUT"
}
Expand Down

0 comments on commit 0cb4e49

Please sign in to comment.