diff --git a/scripts/remote-common.ps1 b/scripts/remote-common.ps1 index 8bc382a..d555fc2 100644 --- a/scripts/remote-common.ps1 +++ b/scripts/remote-common.ps1 @@ -59,9 +59,10 @@ function Test-IsPathLike([string]$Value) { function Resolve-RemoteTarget([string]$Name) { if ($Name -eq 'latest') { - $raw = (Invoke-RemoteQuery "find $script:QuarkDir -maxdepth 1 -mindepth 1 -type d -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2-") -join "`n" + # 取最近改动的目录;排除 _reports / Finish / 隐藏目录这类非下载目录 + $raw = (Invoke-RemoteQuery "find $script:QuarkDir -maxdepth 1 -mindepth 1 -type d -not -name '.*' -not -name '_*' -not -name Finish -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2-") -join "`n" $latest = $raw.Trim() - if (-not $latest) { throw "$script:QuarkDir 下没有任何子目录" } + if (-not $latest) { throw "$script:QuarkDir 下没有任何可处理目录" } return $latest }