File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed
Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change 1313# Colors
1414GREEN=' \033[0;32m'
1515BLUE=' \033[0;34m'
16+ YELLOW=' \033[1;33m'
1617RED=' \033[0;31m'
1718NC=' \033[0m'
1819
@@ -59,10 +60,20 @@ if [ -d "$INSTALL_DIR" ]; then
5960 fi
6061 fi
6162
62- git fetch origin
63- git reset --hard " origin/$BRANCH "
64- git clean -fd
65- echo -e " ${GREEN} Successfully reset to origin/$BRANCH and cleaned worktree.${NC} "
63+ # Prompt for confirmation BEFORE any git operations
64+ echo -e " ${YELLOW} Existing repository detected at $INSTALL_DIR .${NC} "
65+ echo -e " ${YELLOW} Would you like to fetch and reset to latest origin/$BRANCH ? (y/N)${NC} "
66+ read -p " > " confirm < /dev/tty
67+
68+ if [[ " $confirm " == " y" || " $confirm " == " Y" ]]; then
69+ echo -e " ${BLUE} Updating repository...${NC} "
70+ git fetch origin
71+ git reset --hard " origin/$BRANCH "
72+ git clean -fd
73+ echo -e " ${GREEN} Successfully updated and cleaned worktree.${NC} "
74+ else
75+ echo -e " ${BLUE} Skipping update. Using existing local code.${NC} "
76+ fi
6677 else
6778 # Directory exists but is NOT a git repo (e.g. manual mkdir or unzip)
6879 if [ " $( ls -A $INSTALL_DIR ) " ]; then
@@ -105,7 +116,8 @@ if [ -f "$DEPLOY_SCRIPT" ]; then
105116 echo " "
106117 # Switch to directory before execution to ensure relative paths work
107118 cd " $INSTALL_DIR "
108- exec ./setup-services.sh
119+ # Ensure stdin is attached to terminal for interactive input
120+ exec ./setup-services.sh < /dev/tty
109121else
110122 echo -e " ${RED} Critical Error: setup-services.sh not found in downloaded repository!${NC} "
111123 exit 1
You can’t perform that action at this time.
0 commit comments