diff options
author | Carey <kcarey1@APC02S226SG8WM.local> | 2020-10-28 07:40:54 -0500 |
---|---|---|
committer | Carey <kcarey1@APC02S226SG8WM.local> | 2020-10-28 07:40:54 -0500 |
commit | 99ad9cbdefee94007511ec2e53437951cf0e4305 (patch) | |
tree | 168c9886965ad5e5f36f4fbbad55cd5f70c5124e /docs/static | |
parent | 6aae66782682ffcabf953d785308b83ee16fc3b6 (diff) | |
parent | cb922fd8a2a3eddcbece040ca3727d43b171ffe3 (diff) |
Merge https://github.com/zmkfirmware/zmk into refactor_kconfig
Diffstat (limited to 'docs/static')
-rw-r--r-- | docs/static/setup.ps1 | 6 | ||||
-rw-r--r-- | docs/static/setup.sh | 57 |
2 files changed, 51 insertions, 12 deletions
diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1 index 63bd5c0..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", "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", "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 96e8768..cdd6bc4 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 +# 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 + 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 + 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:" @@ -58,7 +92,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" "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,9 +107,14 @@ 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="M60" shield="m60"; split="n"; break;; - 9 ) shield_title="Microdox" shield="microdox"; split="y"; 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;; + 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;; @@ -133,10 +172,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 |