From cc7e6a9c073bdcd4103d948951c88884d38cfac9 Mon Sep 17 00:00:00 2001 From: stevefoxru <53931856+stevefoxru@users.noreply.github.com> Date: Tue, 22 Apr 2025 17:19:52 +0300 Subject: [PATCH] Update install.sh --- install.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/install.sh b/install.sh index fcbb7b1..7d7fc37 100644 --- a/install.sh +++ b/install.sh @@ -89,7 +89,17 @@ check_github_updates() { echo -e "${YELLOW}Доступно обновление (текущий SHA: $local_sha, последний SHA: $latest_sha)${NC}" echo -ne "${BLUE}1) Установить 2) Отменить: ${NC}"; read choice if [[ "$choice" == "1" ]]; then + # Проверка на наличие локальных изменений + if git status --porcelain | grep -q .; then + echo -e "${YELLOW}Обнаружены локальные изменения. Сбрасываем их...${NC}" + run_with_spinner "Сброс локальных изменений" "git reset --hard && git clean -fd" + fi + # Выполнение git pull run_with_spinner "Обновление репозитория" "git pull" + if [ $? -ne 0 ]; then + echo -e "${RED}Не удалось обновить репозиторий${NC}" + cd ..; return 1 + fi echo "$latest_sha" > "$LOCAL_VERSION_FILE" # Проверка обновления самого скрипта check_script_update