From 3991e6ae79bc00f4b7b5074610d3b8ef21bdb37f Mon Sep 17 00:00:00 2001 From: Harry Wixley Date: Mon, 7 Aug 2023 09:48:34 +0100 Subject: [PATCH 1/2] GPT-commit: feat: Update autoupdate logic in wix-cli.sh GPT-commit: fix(autoupdate): Update logic in wix-cli.sh to improve auto-update feature. --- wix-cli.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wix-cli.sh b/wix-cli.sh index 31b6035..6bb8388 100755 --- a/wix-cli.sh +++ b/wix-cli.sh @@ -26,12 +26,17 @@ pull() { wix_update() { info_text "Checking for updates..." - if [ "$branch" != "master" ]; then + + cd "$mydir" || return 1 + repo_branch="" + if git rev-parse --git-dir > /dev/null 2>&1; then + repo_branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') + fi + if [ "$repo_branch" != "master" ]; then warn_text "Not on master branch, skipping update" return 1 fi - cd "$mydir" || return 1 git fetch UPSTREAM=${1:-'@{u}'} LOCAL=$(git rev-parse @) From 3e739d948664bc28c407cca190e0f8d6f20ee551 Mon Sep 17 00:00:00 2001 From: Harry Wixley Date: Mon, 7 Aug 2023 11:12:09 +0100 Subject: [PATCH 2/2] GPT-commit: Update wix-cli.sh GPT-commit: Update wix-cli.sh with modifications to the functions related to deeplinkUrlParam for improved performance and functionality. --- wix-cli.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wix-cli.sh b/wix-cli.sh index 6bb8388..6484647 100755 --- a/wix-cli.sh +++ b/wix-cli.sh @@ -27,6 +27,7 @@ pull() { wix_update() { info_text "Checking for updates..." + current_dir=$(pwd) cd "$mydir" || return 1 repo_branch="" if git rev-parse --git-dir > /dev/null 2>&1; then @@ -34,6 +35,7 @@ wix_update() { fi if [ "$repo_branch" != "master" ]; then warn_text "Not on master branch, skipping update" + cd "$current_dir" || return 1 return 1 fi @@ -54,9 +56,9 @@ wix_update() { echo "Diverged" fi echo "" - { - cd - || return 1 - } &> /dev/null + # { + cd "$current_dir" || return 1 + # } &> /dev/null } wix_update ""