From f9e8866a520051385bcb89a60caaef0ec2fe23ad Mon Sep 17 00:00:00 2001 From: Kellen Carey Date: Sat, 10 Oct 2020 18:28:16 -0700 Subject: add support for wget to setup.sh --- docs/static/setup.sh | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) (limited to 'docs/static') diff --git a/docs/static/setup.sh b/docs/static/setup.sh index 96e8768..fc5a7cd 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -9,15 +9,25 @@ set -e check_exists() { command_to_run=$1 error_message=$2 + local __resultvar=$3 if ! eval "$command_to_run" &> /dev/null; then - printf "%s\n" "$error_message" - exit 1 + if [[ "$__resultvar" != "" ]]; then + eval $__resultvar="'false'" + else + printf "%s\n" "$error_message" + exit 1 + fi + else + if [[ "$__resultvar" != "" ]]; then + eval $__resultvar="'true'" + fi fi } check_exists "command -v git" "git is not installed, and is required for this script!" -check_exists "command -v curl" "curl is not installed, and is required for this script!" +check_exists "command -v curl" "curl is not installed, and is required for this script!" curl_exists +check_exists "command -v wget" "wget is not installed, and is required for this script!" wget_exists check_exists "git config user.name" "Git username not set!\nRun: git config --global user.name 'My Name'" check_exists "git config user.email" "Git email not set!\nRun: git config --global user.email 'example@myemail.com'" @@ -29,6 +39,30 @@ if [ ! -w `pwd` ]; then exit 1 fi +if [[ $curl_exists == "true" && $wget_exists == "true" ]]; then + prompt="Detected both curl and wget, which one would you like to use? [default is curl]" + options=("curl" "wget") + PS3="$prompt " + select opt in "${options[@]}" "Quit"; do + case "$REPLY" in + + 1 ) download_command="curl -O "; break;; + 2 ) download_command="wget "; break;; + + $(( ${#options[@]}+1 )) ) echo "Goodbye!"; exit 1;; + *) download_command="curl -O "; break;; + + esac + done +elif [[ $curl_exists == "true" ]]; then + download_command="curl -O " +elif [[ $wget_exists == "true" ]]; then + download_command="wget " +else + echo 'Neither curl nor wget are installed. One of the two is required for this script!' + exit 1 +fi + repo_path="https://github.com/zmkfirmware/zmk-config-split-template.git" title="ZMK Config Setup:" @@ -133,10 +167,10 @@ cd ${repo_name} pushd config -curl -O "https://raw.githubusercontent.com/zmkfirmware/zmk/main/app/boards/shields/${shield}/${shield}.conf" +$download_command "https://raw.githubusercontent.com/zmkfirmware/zmk/main/app/boards/shields/${shield}/${shield}.conf" if [ "$copy_keymap" == "yes" ]; then - curl -O "https://raw.githubusercontent.com/zmkfirmware/zmk/main/app/boards/shields/${shield}/${shield}.keymap" + $download_command "https://raw.githubusercontent.com/zmkfirmware/zmk/main/app/boards/shields/${shield}/${shield}.keymap" fi popd -- cgit v1.2.3 From b738cc9d75e50bf7400a621c33ce32e697f3c250 Mon Sep 17 00:00:00 2001 From: Kellen Carey Date: Sat, 10 Oct 2020 19:16:07 -0700 Subject: add option to use wget --- docs/static/setup.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'docs/static') diff --git a/docs/static/setup.sh b/docs/static/setup.sh index fc5a7cd..b5abb28 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -39,21 +39,21 @@ if [ ! -w `pwd` ]; then exit 1 fi +# Parse all commandline options +while [[ "$#" -gt 0 ]]; do + case $1 in + -w|--wget) force_wget="true"; break;; + *) echo "Unknown parameter: $1"; exit 1;; + esac + shift +done + if [[ $curl_exists == "true" && $wget_exists == "true" ]]; then - prompt="Detected both curl and wget, which one would you like to use? [default is curl]" - options=("curl" "wget") - PS3="$prompt " - select opt in "${options[@]}" "Quit"; do - case "$REPLY" in - - 1 ) download_command="curl -O "; break;; - 2 ) download_command="wget "; break;; - - $(( ${#options[@]}+1 )) ) echo "Goodbye!"; exit 1;; - *) download_command="curl -O "; break;; - - esac - done + if [[ $force_wget == "true" ]]; then + download_command="wget " + else + download_command="curl -O " + fi elif [[ $curl_exists == "true" ]]; then download_command="curl -O " elif [[ $wget_exists == "true" ]]; then -- cgit v1.2.3 From 94bc2c31b14d5ace4c51f409f934ef077323eb32 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Tue, 13 Oct 2020 00:23:25 -0400 Subject: feat: Add a couple missing shields to user setup. --- docs/static/setup.ps1 | 6 +++--- docs/static/setup.sh | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'docs/static') diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1 index 63bd5c0..1686be2 100644 --- a/docs/static/setup.ps1 +++ b/docs/static/setup.ps1 @@ -91,9 +91,9 @@ Write-Host "Keyboard Shield Selection:" $prompt = "Pick a keyboard" # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. -$options = "Kyria", "Lily58", "Corne", "Splitreus62", "Sofle", "Iris", "RoMac", "makerdiary M60", "Microdox" -$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "romac", "m60", "microdox" -$splits = "y", "y", "y", "y", "y", "y", "n", "n", "y" +$options = "Kyria", "Lily58", "Corne", "Splitreus62", "Sofle", "Iris", "RoMac", "RoMac+", "makerdiary M60", "Microdox", "TG4X" +$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "romac", "romac_plus", "m60", "microdox", "tg4x" +$splits = "y", "y", "y", "y", "y", "y", "n", "n", "n", "y", "n" $choice = Get-Choice-From-Options -Options $options -Prompt $prompt $shield_title = $($options[$choice]) diff --git a/docs/static/setup.sh b/docs/static/setup.sh index 96e8768..d7e2b8c 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -58,7 +58,7 @@ echo "" echo "Keyboard Shield Selection:" prompt="Pick an keyboard:" -options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "RoMac" "makerdiary M60" "Microdox") +options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "RoMac" "RoMac+" "makerdiary M60" "Microdox" "TG4X") PS3="$prompt " # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. @@ -74,8 +74,10 @@ select opt in "${options[@]}" "Quit"; do 5 ) shield_title="Sofle" shield="sofle"; split="y"; break;; 6 ) shield_title="Iris" shield="iris"; split="y"; break;; 7 ) shield_title="RoMac" shield="romac"; split="n"; break;; - 8 ) shield_title="M60" shield="m60"; split="n"; break;; - 9 ) shield_title="Microdox" shield="microdox"; split="y"; break;; + 8 ) shield_title="RoMac+" shield="romac_plus"; split="n"; break;; + 9 ) shield_title="M60" shield="m60"; split="n"; break;; + 10 ) shield_title="Microdox" shield="microdox"; split="y"; break;; + 11 ) shield_title="TG4X" shield="tg4x"; split="n"; break;; # Add link to docs on adding your own custom shield in your ZMK config! # $(( ${#options[@]}+1 )) ) echo "Other!"; break;; -- cgit v1.2.3 From 43c900f94a9394bc09bdfc646bfd3f42f947d927 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Tue, 13 Oct 2020 19:46:02 -0400 Subject: feat: Add qaz to setup scripts. --- docs/static/setup.ps1 | 6 +++--- docs/static/setup.sh | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'docs/static') diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1 index 1686be2..5ebd376 100644 --- a/docs/static/setup.ps1 +++ b/docs/static/setup.ps1 @@ -91,9 +91,9 @@ Write-Host "Keyboard Shield Selection:" $prompt = "Pick a keyboard" # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. -$options = "Kyria", "Lily58", "Corne", "Splitreus62", "Sofle", "Iris", "RoMac", "RoMac+", "makerdiary M60", "Microdox", "TG4X" -$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "romac", "romac_plus", "m60", "microdox", "tg4x" -$splits = "y", "y", "y", "y", "y", "y", "n", "n", "n", "y", "n" +$options = "Kyria", "Lily58", "Corne", "Splitreus62", "Sofle", "Iris", "RoMac", "RoMac+", "makerdiary M60", "Microdox", "TG4X", "QAZ" +$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "romac", "romac_plus", "m60", "microdox", "tg4x", "qaz" +$splits = "y", "y", "y", "y", "y", "y", "n", "n", "n", "y", "n", "n" $choice = Get-Choice-From-Options -Options $options -Prompt $prompt $shield_title = $($options[$choice]) diff --git a/docs/static/setup.sh b/docs/static/setup.sh index d7e2b8c..e45a7ed 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -58,7 +58,7 @@ echo "" echo "Keyboard Shield Selection:" prompt="Pick an keyboard:" -options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "RoMac" "RoMac+" "makerdiary M60" "Microdox" "TG4X") +options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "RoMac" "RoMac+" "makerdiary M60" "Microdox" "TG4X" "QAZ") PS3="$prompt " # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. @@ -78,6 +78,7 @@ select opt in "${options[@]}" "Quit"; do 9 ) shield_title="M60" shield="m60"; split="n"; break;; 10 ) shield_title="Microdox" shield="microdox"; split="y"; break;; 11 ) shield_title="TG4X" shield="tg4x"; split="n"; break;; + 12 ) shield_title="QAZ" shield="qaz"; split="n"; break;; # Add link to docs on adding your own custom shield in your ZMK config! # $(( ${#options[@]}+1 )) ) echo "Other!"; break;; -- cgit v1.2.3 From 7296b967978be3483a11a3a5ea2b2eaeb8b23ce8 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 24 Oct 2020 21:08:00 -0500 Subject: Add Reviung41 Shield Definitions --- docs/static/setup.ps1 | 6 +++--- docs/static/setup.sh | 15 ++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'docs/static') diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1 index 5ebd376..fac1732 100644 --- a/docs/static/setup.ps1 +++ b/docs/static/setup.ps1 @@ -91,9 +91,9 @@ Write-Host "Keyboard Shield Selection:" $prompt = "Pick a keyboard" # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. -$options = "Kyria", "Lily58", "Corne", "Splitreus62", "Sofle", "Iris", "RoMac", "RoMac+", "makerdiary M60", "Microdox", "TG4X", "QAZ" -$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "romac", "romac_plus", "m60", "microdox", "tg4x", "qaz" -$splits = "y", "y", "y", "y", "y", "y", "n", "n", "n", "y", "n", "n" +$options = "Kyria", "Lily58", "Corne", "Splitreus62", "Sofle", "Iris", "Reviung41", "RoMac", "RoMac+", "makerdiary M60", "Microdox", "TG4X", "QAZ" +$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "reviung41", "romac", "romac_plus", "m60", "microdox", "tg4x", "qaz" +$splits = "y", "y", "y", "y", "y", "y", "n", "n", "n", "n", "y", "n", "n" $choice = Get-Choice-From-Options -Options $options -Prompt $prompt $shield_title = $($options[$choice]) diff --git a/docs/static/setup.sh b/docs/static/setup.sh index e45a7ed..3d37024 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -58,7 +58,7 @@ echo "" echo "Keyboard Shield Selection:" prompt="Pick an keyboard:" -options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "RoMac" "RoMac+" "makerdiary M60" "Microdox" "TG4X" "QAZ") +options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "Reviung41" "RoMac" "RoMac+" "makerdiary M60" "Microdox" "TG4X" "QAZ") PS3="$prompt " # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. @@ -73,12 +73,13 @@ select opt in "${options[@]}" "Quit"; do 4 ) shield_title="Splitreus62" shield="splitreus62"; split="y"; break;; 5 ) shield_title="Sofle" shield="sofle"; split="y"; break;; 6 ) shield_title="Iris" shield="iris"; split="y"; break;; - 7 ) shield_title="RoMac" shield="romac"; split="n"; break;; - 8 ) shield_title="RoMac+" shield="romac_plus"; split="n"; break;; - 9 ) shield_title="M60" shield="m60"; split="n"; break;; - 10 ) shield_title="Microdox" shield="microdox"; split="y"; break;; - 11 ) shield_title="TG4X" shield="tg4x"; split="n"; break;; - 12 ) shield_title="QAZ" shield="qaz"; split="n"; break;; + 7 ) shield_title="Reviung41" shield="reviung41"; split="n"; break;; + 8 ) shield_title="RoMac" shield="romac"; split="n"; break;; + 9 ) shield_title="RoMac+" shield="romac_plus"; split="n"; break;; + 10 ) shield_title="M60" shield="m60"; split="n"; break;; + 11 ) shield_title="Microdox" shield="microdox"; split="y"; break;; + 12 ) shield_title="TG4X" shield="tg4x"; split="n"; break;; + 13 ) shield_title="QAZ" shield="qaz"; split="n"; break;; # Add link to docs on adding your own custom shield in your ZMK config! # $(( ${#options[@]}+1 )) ) echo "Other!"; break;; -- cgit v1.2.3 From d90592aac5cec02da1959d7ede7ceccb5265f126 Mon Sep 17 00:00:00 2001 From: Jay Greco Date: Wed, 21 Oct 2020 20:17:31 -0700 Subject: Add NIBBLE shield + Added required files for nullbits NIBBLE --- docs/static/setup.ps1 | 6 +++--- docs/static/setup.sh | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'docs/static') diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1 index fac1732..89ead01 100644 --- a/docs/static/setup.ps1 +++ b/docs/static/setup.ps1 @@ -91,9 +91,9 @@ Write-Host "Keyboard Shield Selection:" $prompt = "Pick a keyboard" # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. -$options = "Kyria", "Lily58", "Corne", "Splitreus62", "Sofle", "Iris", "Reviung41", "RoMac", "RoMac+", "makerdiary M60", "Microdox", "TG4X", "QAZ" -$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "reviung41", "romac", "romac_plus", "m60", "microdox", "tg4x", "qaz" -$splits = "y", "y", "y", "y", "y", "y", "n", "n", "n", "n", "y", "n", "n" +$options = "Kyria", "Lily58", "Corne", "Splitreus62", "Sofle", "Iris", "Reviung41", "RoMac", "RoMac+", "makerdiary M60", "Microdox", "TG4X", "QAZ", "NIBBLE" +$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "reviung41", "romac", "romac_plus", "m60", "microdox", "tg4x", "qaz", "nibble" +$splits = "y", "y", "y", "y", "y", "y", "n", "n", "n", "n", "y", "n", "n", "n" $choice = Get-Choice-From-Options -Options $options -Prompt $prompt $shield_title = $($options[$choice]) diff --git a/docs/static/setup.sh b/docs/static/setup.sh index 294e46e..cdd6bc4 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -114,6 +114,7 @@ select opt in "${options[@]}" "Quit"; do 11 ) shield_title="Microdox" shield="microdox"; split="y"; break;; 12 ) shield_title="TG4X" shield="tg4x"; split="n"; break;; 13 ) shield_title="QAZ" shield="qaz"; split="n"; break;; + 14 ) shield_title="NIBBLE" shield="nibble"; split="n"; break;; # Add link to docs on adding your own custom shield in your ZMK config! # $(( ${#options[@]}+1 )) ) echo "Other!"; break;; -- cgit v1.2.3