diff --git a/scripts/deploy.ps1 b/scripts/deploy.ps1 index 9a5a773..a67e808 100644 --- a/scripts/deploy.ps1 +++ b/scripts/deploy.ps1 @@ -86,9 +86,11 @@ try { & git push origin main if ($LASTEXITCODE -ne 0) { throw 'git push 失败' } - Invoke-RemoteScript @" + # 单引号 here-string:保留 shell 的 $1/$src/$dst,避免被 PowerShell 提前展开 + Invoke-RemoteScript @' set -euo pipefail -cd $RemoteRepo +REPO=/home/ali/docker/tools/python/SceneMarshal +cd "$REPO" git fetch --prune origin git reset --hard origin/main echo '=== 远端 HEAD ===' @@ -107,9 +109,9 @@ install_tool() { echo "⚠️ 安装失败: $dst(需要免密 sudo)" fi } -install_tool "$RemoteRepo/scripts/media-rename" /usr/local/bin/media-rename -install_tool "$RemoteRepo/scripts/media_archive.py" /usr/local/bin/media-archive -"@ +install_tool "$REPO/scripts/media-rename" /usr/local/bin/media-rename +install_tool "$REPO/scripts/media_archive.py" /usr/local/bin/media-archive +'@ } else { $tgz = Join-Path ([IO.Path]::GetTempPath()) 'SceneMarshal-sync.tgz'