summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/get_version.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/get_version.sh b/bin/get_version.sh
index 6a5007b..aa23e17 100755
--- a/bin/get_version.sh
+++ b/bin/get_version.sh
@@ -5,11 +5,18 @@ date=$(date -u +"%Y%m%d")
branch=${1:-$(git rev-parse --abbrev-ref HEAD | cut -c1-4)}
commit=${2:-$(git rev-parse --short HEAD)}
+uppercase_char() {
+ local char=$1
+
+ (echo $char | tr '[a-z]' '[A-Z]' 2> /dev/null) || echo "${char^^}"
+}
+
# Function to transform characters to ZMK key behaviours
transform_char() {
local char=$1
+
if [[ $char =~ [A-Za-z] ]]; then
- echo "<&kp ${char^^}>, "
+ echo "<&kp $(uppercase_char $char)>, "
elif [[ $char =~ [0-9] ]]; then
echo "<&kp N${char}>, "
elif [ "$char" = "." ]; then