fix(wrapper): latest 跳过 _reports/Finish/隐藏目录
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user