summaryrefslogtreecommitdiff
path: root/docs/static
diff options
context:
space:
mode:
authorCrossR <r.cross@lancaster.ac.uk>2020-09-24 17:42:34 +0100
committerCrossR <r.cross@lancaster.ac.uk>2020-09-24 19:28:02 +0100
commitcd194dbac4747126f017ce6e9ddf070ca6cc1fef (patch)
tree335609e9ecc095a854cf7c8266e88d92b9ff961b /docs/static
parent550c35db23f15c6835a43fe1d2e4a3b5a04ac2b8 (diff)
Add licenses.
Diffstat (limited to 'docs/static')
-rw-r--r--docs/static/setup.ps18
-rw-r--r--docs/static/setup.sh19
2 files changed, 18 insertions, 9 deletions
diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1
index a2d66ee..3946e66 100644
--- a/docs/static/setup.ps1
+++ b/docs/static/setup.ps1
@@ -1,3 +1,7 @@
+# Copyright (c) 2020 The ZMK Contributors
+#
+# SPDX-License-Identifier: MIT
+
$ErrorActionPreference = "Stop"
function Get-Choice-From-Options {
@@ -10,7 +14,7 @@ function Get-Choice-From-Options {
for ($i = 0; $i -lt $Options.length; $i++) {
Write-Host "$($i + 1)) $($Options[$i])"
}
-
+
Write-Host "$($Options.length + 1)) Quit"
$selection = Read-Host $Prompt
@@ -103,7 +107,7 @@ if ($github_user -ne "") {
}
$github_repo = Read-Host "GitHub Repo [https://github.com/$github_user/$repo_name.git]"
-
+
if ($github_repo -eq "") {
$github_repo = "https://github.com/$github_user/$repo_name.git"
}
diff --git a/docs/static/setup.sh b/docs/static/setup.sh
index df985a6..5bf3645 100644
--- a/docs/static/setup.sh
+++ b/docs/static/setup.sh
@@ -1,11 +1,15 @@
#!/bin/bash
+# Copyright (c) 2020 The ZMK Contributors
+#
+# SPDX-License-Identifier: MIT
+
set -e
check_exists() {
command_to_run=$1
error_message=$2
-
+
if ! eval "$command_to_run" &> /dev/null; then
printf "%s\n" "$error_message"
exit 1
@@ -28,7 +32,7 @@ echo "$title"
echo ""
echo "MCU Board Selection:"
PS3="$prompt "
-select opt in "${options[@]}" "Quit"; do
+select opt in "${options[@]}" "Quit"; do
case "$REPLY" in
@@ -50,8 +54,8 @@ options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "RoMac")
PS3="$prompt "
# TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos.
-# select opt in "${options[@]}" "Other" "Quit"; do
-select opt in "${options[@]}" "Quit"; do
+# select opt in "${options[@]}" "Other" "Quit"; do
+select opt in "${options[@]}" "Quit"; do
case "$REPLY" in
@@ -64,7 +68,7 @@ select opt in "${options[@]}" "Quit"; do
7 ) shield_title="RoMac" shield="romac"; split="n"; break;;
# Add link to docs on adding your own custom shield in your ZMK config!
- # $(( ${#options[@]}+1 )) ) echo "Other!"; break;;
+ # $(( ${#options[@]}+1 )) ) echo "Other!"; break;;
$(( ${#options[@]}+1 )) ) echo "Goodbye!"; exit 1;;
*) echo "Invalid option. Try another one.";continue;;
@@ -148,9 +152,10 @@ git commit -m "Initial User Config."
if [ -n "$github_repo" ]; then
git remote add origin "$github_repo"
git push --set-upstream origin "$(git symbolic-ref --short HEAD)"
+ push_return_code=$?
# If push failed, assume that the origin was incorrect and give instructions on fixing.
- if [ $? -ne 0 ] {
+ if [ ${push_return_code} -ne 0 ]; then
echo "Remote repository $github_repo not found..."
echo "Check GitHub URL, and try adding again."
echo "Run the following: "
@@ -159,7 +164,7 @@ if [ -n "$github_repo" ]; then
echo " git push --set-upstream origin $(git symbolic-ref --short HEAD)"
echo "Once pushed, your firmware should be availalbe from GitHub Actions at: ${github_repo%.git}/actions"
exit 1
- }
+ fi
# TODO: Support determing the actions URL when non-https:// repo URL is used.
if [ "${github_repo}" != "${github_repo#https://}" ]; then