diff --git a/Install.ps1 b/Install.ps1 index 59afa05..a15ed79 100644 --- a/Install.ps1 +++ b/Install.ps1 @@ -19,7 +19,10 @@ $repoUrl = "https://github.com/roman-ryzenadvanced/OpenQode-Public-Alpha.git" $targetDir = "OpenQode" if (Test-Path $targetDir) { - Write-Host "Directory '$targetDir' already exists. Entering directory..." -ForegroundColor Yellow + Write-Host "Directory '$targetDir' already exists. Updating..." -ForegroundColor Yellow + Push-Location $targetDir + git pull + Pop-Location } else { Write-Host "Cloning repository..." -ForegroundColor Yellow git clone $repoUrl $targetDir diff --git a/install.sh b/install.sh index 7807db0..7082f46 100644 --- a/install.sh +++ b/install.sh @@ -22,7 +22,14 @@ TARGET_DIR="OpenQode" REPO_URL="https://github.com/roman-ryzenadvanced/OpenQode-Public-Alpha.git" if [ -d "$TARGET_DIR" ]; then - echo -e "\033[1;33mDirectory '$TARGET_DIR' already exists. Entering...\033[0m" + echo -e "\033[1;33mDirectory '$TARGET_DIR' already exists. Updating...\033[0m" + cd "$TARGET_DIR" + git pull + if [ $? -ne 0 ]; then + echo -e "\033[0;31mUpdate failed. Please delete the directory and try again.\033[0m" + exit 1 + fi + cd .. else echo -e "\033[1;33mCloning repository...\033[0m" git clone "$REPO_URL" "$TARGET_DIR"