From 917fd7a8fcef97e9c7fbca5a1925ddc0eac73410 Mon Sep 17 00:00:00 2001 From: Connor Dickey Date: Thu, 5 Jan 2023 19:30:42 -0600 Subject: [PATCH 1/5] Allow script to find all branches. --- contesting_script.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contesting_script.sh b/contesting_script.sh index 8059cc7..2989df1 100644 --- a/contesting_script.sh +++ b/contesting_script.sh @@ -129,7 +129,10 @@ cd ~/.node-red/projects/Node-Red-Contesting-Dashboard else cd ~/.node-red/projects/Node-Red-Contesting-Dashboard git config pull.rebase true -git restore flow.json +git restore flow.json +for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do \ + git branch --track ${branch#remotes/origin/} $branch ; \ +done git pull &> /dev/null fi echo " Y" From 3e63f519f17c75014c741dc23685555977cca033 Mon Sep 17 00:00:00 2001 From: Connor Dickey Date: Thu, 5 Jan 2023 21:18:23 -0600 Subject: [PATCH 2/5] Add variables to choose --- contesting_script.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/contesting_script.sh b/contesting_script.sh index 2989df1..4ddec1e 100644 --- a/contesting_script.sh +++ b/contesting_script.sh @@ -21,6 +21,25 @@ _start=1 _end=100 clear +while getopts "u:h:d:upgrade:help:defaults" flag +do + case "${flag}" in + u) upgrade="Y";; + h) help="Y";; + d) defaults="Y";; + upgrade) upgrade="Y";; + help) help="Y";; + defaults) defaults="Y";; + + esac +done + +if [[ $upgrade = "Y" || $defaults = "Y" ]]; then +flag_update="N" +dashboard_update="Y" +else if [[ $help = "Y" ]]; then +echo "Welcome to the Node-Red Contesting Dashboard script. adding -u| -upgrade will update your current dashbaord, while -d will use the standard defaults." +else ## ---- Initial Questioning ---- ## printf "Welcome to the NodeRed Dashboards.\nPlease hit enter to continue. " read @@ -32,6 +51,7 @@ echo "Are you wanting to update the Dashboard? Note this will not delete your da read -p "(Y/n) " dashboard_update # Are you a dev? read -p "Are you planning to help develop any of the dashboards? (y/N)" flag_dev +fi if [[ $flag_dev == 'Y' || $flag_dev == 'y' ]] ; then read -p "What is your Github Username?" git_username read -p "What is your Github Email?" git_email @@ -39,7 +59,6 @@ else git_username=nobody git_email=example@example.com fi - ## ---- Update RPI ---- ## if [[ $flag_update != 'n' ]] && [[ $flag_update != 'N' ]]; then echo "Updating and Upgrading your Pi to newest standards" From 09a31585743d058b4633a2d4418fb34b5b53aa4c Mon Sep 17 00:00:00 2001 From: Connor Dickey Date: Thu, 5 Jan 2023 21:27:27 -0600 Subject: [PATCH 3/5] Clean else if to elif --- contesting_script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contesting_script.sh b/contesting_script.sh index 4ddec1e..2215bc6 100644 --- a/contesting_script.sh +++ b/contesting_script.sh @@ -37,7 +37,7 @@ done if [[ $upgrade = "Y" || $defaults = "Y" ]]; then flag_update="N" dashboard_update="Y" -else if [[ $help = "Y" ]]; then +elif [[ $help = "Y" ]]; then echo "Welcome to the Node-Red Contesting Dashboard script. adding -u| -upgrade will update your current dashbaord, while -d will use the standard defaults." else ## ---- Initial Questioning ---- ## From 655e3b6968580a18714a851ccf154046e82215aa Mon Sep 17 00:00:00 2001 From: Connor Dickey Date: Thu, 5 Jan 2023 22:23:12 -0600 Subject: [PATCH 4/5] clear branch info --- contesting_script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contesting_script.sh b/contesting_script.sh index 2215bc6..f359dff 100644 --- a/contesting_script.sh +++ b/contesting_script.sh @@ -150,7 +150,7 @@ cd ~/.node-red/projects/Node-Red-Contesting-Dashboard git config pull.rebase true git restore flow.json for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do \ - git branch --track ${branch#remotes/origin/} $branch ; \ + git branch --track ${branch#remotes/origin/} $branch ; &> /dev/null done git pull &> /dev/null fi From 21929095fde86775682d7a6607cd74c70833f308 Mon Sep 17 00:00:00 2001 From: Connor Dickey Date: Thu, 5 Jan 2023 22:32:03 -0600 Subject: [PATCH 5/5] remove messages --- contesting_script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contesting_script.sh b/contesting_script.sh index f359dff..2c73310 100644 --- a/contesting_script.sh +++ b/contesting_script.sh @@ -150,7 +150,7 @@ cd ~/.node-red/projects/Node-Red-Contesting-Dashboard git config pull.rebase true git restore flow.json for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do \ - git branch --track ${branch#remotes/origin/} $branch ; &> /dev/null + git branch --track ${branch#remotes/origin/} $branch &> /dev/null done git pull &> /dev/null fi