diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-07-26 09:46:21 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-07-26 09:46:21 +0200 |
commit | 4b1268f39ec3720ca6aae10d3629db59f60485d3 (patch) | |
tree | 7708e8d39ea7024334d9d9208ef8566ad7c5c777 /scripts/format.sh | |
parent | refactor(rgb): Make the Rgb map readable and changeable (diff) | |
download | qmk_layout-4b1268f39ec3720ca6aae10d3629db59f60485d3.zip |
feat(format): Support formatting the new led-layout files
Diffstat (limited to 'scripts/format.sh')
-rwxr-xr-x | scripts/format.sh | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/scripts/format.sh b/scripts/format.sh index d9db529..c93fb3b 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -4,11 +4,25 @@ root="$(git rev-parse --show-toplevel)" final="$(mktemp)" -format "$root/src/keymaps/soispha/layout/keymap.h" > "$final" +mode="$1" +target="/dev/null" -git add "$root/src/keymaps/soispha/layout/keymap.h" +if [ "$mode" = "keymap.h" ]; then + target="$root/src/keymaps/soispha/layout/keymap.h" +elif [ "$mode" = "ledmap.h" ]; then + target="$root/src/keymaps/soispha/led/ledlayout.h" +elif [ "$mode" = "translation.h" ]; then + target="$root/src/keymaps/soispha/led/translation.h" + mode="ledmap.h" +else + echo "$mode" is invalid + exit 2 +fi -cat "$final" > "$root/src/keymaps/soispha/layout/keymap.h" +format "$mode" "$target" >"$final" +git add "$target" + +cat "$final" >"$target" rm "$final" # vim: ft=sh |