From 67688daf6efea89e7467c1cfc016954630ca31df Mon Sep 17 00:00:00 2001 From: retrozinndev Date: Sun, 26 Oct 2025 16:58:44 -0300 Subject: [PATCH] :boom: fix(install, update): repo branch stuff --- install.sh | 11 ++++++++++- update.sh | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index a04fa4e..7ebb1a9 100755 --- a/install.sh +++ b/install.sh @@ -55,7 +55,14 @@ if [[ "$answer" == y ]] || [[ "$skip_prompts" ]]; then Send_log "The installer noticed that you're calling the script remotely" rm -rf $repo_directory 2> /dev/null Send_log "Cloning repository in \`$repo_directory\`..." - git clone https://github.com/retrozinndev/colorshell.git "$repo_directory" + if [[ -d $repo_directory ]]; then + Send_log "repo is already cloned! let's just fetch the latest changes..." + git -C "$repo_directory" stash # if there are changes, let's just stash them + git -C "$repo_directory" fetch && git -C "$repo_directory" pull --rebase + git -C "$repo_directory" stash pop # pop changes back if there are any + else + git clone https://github.com/retrozinndev/colorshell.git "$repo_directory" + fi fi Ask "Nice! Do you want to use the stable version instead of the unstable(latest commit)?" @@ -67,6 +74,8 @@ if [[ "$answer" == y ]] || [[ "$skip_prompts" ]]; then Send_log "Done fetching" Send_log "Checking out latest non-pre-release version: $latest_tag" git -C "$repo_directory" checkout $latest_tag > /dev/null 2>&1 + else + git -C "$repo_directory" checkout ryo > /dev/null 2>&1 fi Send_log "Starting installation..." diff --git a/update.sh b/update.sh index 651766e..e85ec91 100755 --- a/update.sh +++ b/update.sh @@ -89,6 +89,8 @@ if [[ "$answer" == y ]] || [[ "$skip_prompts" ]]; then Send_log "Done fetching" Send_log "Checking out latest non-pre-release version: $latest_tag" git -C "$repo_directory" checkout $latest_tag > /dev/null 2>&1 + else + git -C "$repo_directory" checkout ryo > /dev/null 2>&1 fi Send_log "Updating..."