From 4b1268f39ec3720ca6aae10d3629db59f60485d3 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 26 Jul 2025 09:46:21 +0200 Subject: feat(format): Support formatting the new led-layout files --- scripts/format.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'scripts') 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 -- cgit 1.4.1