Prefer tr to ${char^^}, which does not work on older bash versions (#303)
* Prefer `tr` to ${char^^}, which does not work on older bash versions
* Update CHANGELOG.md
---------
Co-authored-by: ReFil <[email protected]>
This commit is contained in:
+2
-1
@@ -4,6 +4,8 @@ Here's all notable changes and commits to both the configuration repo and the ba
|
|||||||
Many thanks to all those who have submitted issues and pull requests to make this firmware better!
|
Many thanks to all those who have submitted issues and pull requests to make this firmware better!
|
||||||
## Config repo
|
## Config repo
|
||||||
|
|
||||||
|
12/27/2023 - Change how the characters are used in the versioning script for improved MacOS experience [#303](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/303)
|
||||||
|
|
||||||
12/15/2022 - Update keymap.json to reflect new versioning macro [#300](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/300)
|
12/15/2022 - Update keymap.json to reflect new versioning macro [#300](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/300)
|
||||||
|
|
||||||
12/15/2023 - Add PR template [#293](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/293)
|
12/15/2023 - Add PR template [#293](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/293)
|
||||||
@@ -38,7 +40,6 @@ Many thanks to all those who have submitted issues and pull requests to make thi
|
|||||||
|
|
||||||
3/4/2023 - Add extra keys into matrix that point to nowhere, fixes spurious keypress issues when using USB3.1 cables [#114](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/114) [#116](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/116)
|
3/4/2023 - Add extra keys into matrix that point to nowhere, fixes spurious keypress issues when using USB3.1 cables [#114](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/114) [#116](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/116)
|
||||||
|
|
||||||
|
|
||||||
2/14/2023 - Disable ZMK logging by default to improve power consumption [#101](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/101)
|
2/14/2023 - Disable ZMK logging by default to improve power consumption [#101](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/101)
|
||||||
|
|
||||||
1/25/2023 - Fix automatic OS detection to build properly when using the local builder on OS-X [#91](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/91)
|
1/25/2023 - Fix automatic OS detection to build properly when using the local builder on OS-X [#91](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/91)
|
||||||
|
|||||||
+8
-1
@@ -5,11 +5,18 @@ date=$(date -u +"%Y%m%d")
|
|||||||
branch=${1:-$(git rev-parse --abbrev-ref HEAD | cut -c1-4)}
|
branch=${1:-$(git rev-parse --abbrev-ref HEAD | cut -c1-4)}
|
||||||
commit=${2:-$(git rev-parse --short HEAD)}
|
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
|
# Function to transform characters to ZMK key behaviours
|
||||||
transform_char() {
|
transform_char() {
|
||||||
local char=$1
|
local char=$1
|
||||||
|
|
||||||
if [[ $char =~ [A-Za-z] ]]; then
|
if [[ $char =~ [A-Za-z] ]]; then
|
||||||
echo "<&kp ${char^^}>, "
|
echo "<&kp $(uppercase_char $char)>, "
|
||||||
elif [[ $char =~ [0-9] ]]; then
|
elif [[ $char =~ [0-9] ]]; then
|
||||||
echo "<&kp N${char}>, "
|
echo "<&kp N${char}>, "
|
||||||
elif [ "$char" = "." ]; then
|
elif [ "$char" = "." ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user