update
This commit is contained in:
+15
-3
@@ -1790,8 +1790,10 @@ if (Test-Path (Join-Path $repo ".git")) {
|
||||
$updateText = ($update | Out-String)
|
||||
$repoUpdated = ($updateText -match "Updating|Fast-forward")
|
||||
$repoUpToDate = ($updateText -match "Already up[\s-]+to[\s-]+date")
|
||||
$skipDepUpdate = $false
|
||||
|
||||
if ($gitExit -ne 0) {
|
||||
$skipDepUpdate = $true
|
||||
Write-Host "[mm] Warning: git update check failed; continuing startup." -ForegroundColor Yellow
|
||||
$gitTail = @($update | Select-Object -Last 3)
|
||||
foreach ($line in $gitTail) {
|
||||
@@ -1805,7 +1807,9 @@ if (Test-Path (Join-Path $repo ".git")) {
|
||||
Write-Host "[mm] Repository update check completed." -ForegroundColor DarkGray
|
||||
}
|
||||
|
||||
if (-not $env:MM_NO_DEP_UPDATE -and (Test-Path $py) -and (Test-Path $requirements)) {
|
||||
if ($skipDepUpdate) {
|
||||
Write-Host "[mm] Python module update skipped (network/update check unavailable)." -ForegroundColor DarkGray
|
||||
} elseif (-not $env:MM_NO_DEP_UPDATE -and (Test-Path $py) -and (Test-Path $requirements)) {
|
||||
Write-Host "[mm] Checking Python module updates..." -ForegroundColor DarkGray
|
||||
$depOutput = & $py -m pip install --disable-pip-version-check --upgrade -r $requirements 2>&1
|
||||
$depExit = $LASTEXITCODE
|
||||
@@ -1905,6 +1909,7 @@ if (Test-Path (Join-Path $repo 'CLI.py')) {
|
||||
" git -C \"!REPO!\" pull --ff-only >\"!GIT_OUT!\" 2>&1\n"
|
||||
" set \"GIT_EXIT=!errorlevel!\"\n"
|
||||
" set \"REPO_UPDATED=false\"\n"
|
||||
" set \"SKIP_DEP_UPDATE=false\"\n"
|
||||
" if \"!GIT_EXIT!\" == \"0\" (\n"
|
||||
" findstr /i /c:\"Updating\" /c:\"Fast-forward\" \"!GIT_OUT!\" >nul 2>&1\n"
|
||||
" if !errorlevel! == 0 (\n"
|
||||
@@ -1914,11 +1919,14 @@ if (Test-Path (Join-Path $repo 'CLI.py')) {
|
||||
" echo [mm] Repository already up to date.\n"
|
||||
" )\n"
|
||||
" ) else (\n"
|
||||
" set \"SKIP_DEP_UPDATE=true\"\n"
|
||||
" echo [mm] Warning: git update check failed; continuing startup.\n"
|
||||
" type \"!GIT_OUT!\"\n"
|
||||
" )\n"
|
||||
" del /q \"!GIT_OUT!\" >nul 2>&1\n"
|
||||
" if not defined MM_NO_DEP_UPDATE (\n"
|
||||
" if \"!SKIP_DEP_UPDATE!\" == \"true\" (\n"
|
||||
" echo [mm] Python module update skipped (network/update check unavailable).\n"
|
||||
" ) else if not defined MM_NO_DEP_UPDATE (\n"
|
||||
" if exist \"!PY!\" if exist \"!REQ!\" (\n"
|
||||
" echo [mm] Checking Python module updates...\n"
|
||||
" set \"PIP_OUT=%TEMP%\\mm_pip_update_!RANDOM!_!RANDOM!.log\"\n"
|
||||
@@ -2127,7 +2135,9 @@ if (Test-Path (Join-Path $repo 'CLI.py')) {
|
||||
' UPDATE_OUT=$(git -C "$REPO" pull --ff-only 2>&1)\n'
|
||||
' UPDATE_EXIT=$?\n'
|
||||
' REPO_UPDATED="false"\n'
|
||||
' SKIP_DEP_UPDATE="false"\n'
|
||||
' if [ $UPDATE_EXIT -ne 0 ]; then\n'
|
||||
' SKIP_DEP_UPDATE="true"\n'
|
||||
' echo "[mm] Warning: git update check failed; continuing startup."\n'
|
||||
' printf "%s\n" "$UPDATE_OUT" | tail -n 3\n'
|
||||
' elif echo "$UPDATE_OUT" | grep -qiE \'Updating|Fast-forward\'; then\n'
|
||||
@@ -2144,7 +2154,9 @@ if (Test-Path (Join-Path $repo 'CLI.py')) {
|
||||
' elif [ -x "$VENV/bin/python" ]; then\n'
|
||||
' MM_PY="$VENV/bin/python"\n'
|
||||
' fi\n'
|
||||
' if [ -z "${MM_NO_DEP_UPDATE:-}" ] && [ -n "$MM_PY" ] && [ -f "$REPO/scripts/requirements.txt" ]; then\n'
|
||||
' if [ "$SKIP_DEP_UPDATE" = "true" ]; then\n'
|
||||
' echo "[mm] Python module update skipped (network/update check unavailable)."\n'
|
||||
' elif [ -z "${MM_NO_DEP_UPDATE:-}" ] && [ -n "$MM_PY" ] && [ -f "$REPO/scripts/requirements.txt" ]; then\n'
|
||||
' echo "[mm] Checking Python module updates..."\n'
|
||||
' DEP_OUT=$("$MM_PY" -m pip install --disable-pip-version-check --upgrade -r "$REPO/scripts/requirements.txt" 2>&1)\n'
|
||||
' DEP_EXIT=$?\n'
|
||||
|
||||
Reference in New Issue
Block a user