Browse Source

fix(qmk): fix invalid use of test builtin (#80)

* fix(qmk): fix invalid use of test builtin

Also switch the order of IO redirections while we're at it, the previous
order was wrong and misleading:

https://www.shellcheck.net/wiki/SC2069

* fix(qmk): use double quotes around some variable expansions
Antoine Martin 4 months ago
parent
commit
004de6865c
1 changed files with 4 additions and 4 deletions
  1. 4 4
      qmk/arsenik-qmk.sh

+ 4 - 4
qmk/arsenik-qmk.sh

@@ -18,7 +18,7 @@ fi
 
 
 if [ -z "${EDITOR+x}" ]; then
-    if [ which nano 2>&1 >/dev/null ]; then
+    if which nano >/dev/null 2>&1; then
         EDITOR="nano"
     else
         EDITOR="vi"
@@ -72,14 +72,14 @@ function make_new_arsenik_keymap() {
     # echo "s/ARSENIK_PLACEHOLDER_LAYOUT/$layout/"
     sed -i "s/ARSENIK_PLACEHOLDER_LAYOUT/$layout/" "$arsenik_folder/config.h"
 
-    if [ $no_editor = false ]; then
+    if [ "$no_editor" = false ]; then
         eval "$EDITOR" "$arsenik_folder/config.h"
     fi
 
     case "$qmk_cmd" in
         "none") ;;
-        "build") cd $QMK_PATH && make "$keyboard_name:arsenik";;
-        "flash") cd $QMK_PATH && make "$keyboard_name:arsenik:flash";;
+        "build") cd "$QMK_PATH" && make "$keyboard_name:arsenik";;
+        "flash") cd "$QMK_PATH" && make "$keyboard_name:arsenik:flash";;
     esac
 }