Skip to content

Commit 2a2c205

Browse files
se35710r15ch13
authored andcommitted
checkver: Resolve issue on Powershell >6.1.0 (#2592)
* Fixes #2591
1 parent ba20b88 commit 2a2c205

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

bin/checkurls.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ $dir = resolve-path $dir
2222
# get apps to check
2323
$queue = @()
2424
Get-ChildItem $dir "$search.json" | ForEach-Object {
25-
$manifest = parse_json "$dir\$_"
26-
$queue += ,@($_, $manifest)
25+
$manifest = parse_json "$dir\$($_.Name)"
26+
$queue += ,@($_.Name, $manifest)
2727
}
2828

2929
$original = use_any_https_protocol

bin/checkver.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ if($app) { $search = $app }
3232
# get apps to check
3333
$queue = @()
3434
Get-ChildItem $dir "$search.json" | ForEach-Object {
35-
$json = parse_json "$dir\$_"
35+
$json = parse_json "$dir\$($_.Name)"
3636
if($json.checkver) {
37-
$queue += ,@($_, $json)
37+
$queue += ,@($_.Name, $json)
3838
}
3939
}
4040

bin/describe.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ if($app) { $search = $app }
1515
# get apps to check
1616
$apps = @()
1717
Get-ChildItem $dir "$search.json" | ForEach-Object {
18-
$json = parse_json "$dir\$_"
19-
$apps += ,@(($_ -replace '\.json$', ''), $json)
18+
$json = parse_json "$dir\$($_.Name)"
19+
$apps += ,@(($_.Name -replace '\.json$', ''), $json)
2020
}
2121

2222
$apps | ForEach-Object {

bin/formatjson.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ if ($type -is [System.IO.DirectoryInfo]) {
2222

2323
$files | ForEach-Object {
2424
# beautify
25-
$json = parse_json "$dir$_" | ConvertToPrettyJson
25+
$json = parse_json "$dir$($_.Name)" | ConvertToPrettyJson
2626

2727
# convert to 4 spaces
2828
$json = $json -replace "`t",' '
2929

30-
[System.IO.File]::WriteAllLines("$dir$_", $json)
30+
[System.IO.File]::WriteAllLines("$dir$($_.Name)", $json)
3131
}

bin/missing-checkver.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ write-host "]utoupdate"
1919
write-host " | |"
2020

2121
Get-ChildItem $dir "*.json" | ForEach-Object {
22-
$json = parse_json "$dir\$_"
22+
$json = parse_json "$dir\($_.Name)"
2323

2424
if ($skipSupported -and $json.checkver -and $json.autoupdate) {
2525
return
@@ -32,5 +32,5 @@ Get-ChildItem $dir "*.json" | ForEach-Object {
3232
write-host "[" -nonewline
3333
write-host -f cyan -nonewline $( If ($json.autoupdate) {"A"} Else {" "} )
3434
write-host "] " -nonewline
35-
write-host (strip_ext $_)
35+
write-host (strip_ext $_.Name)
3636
}

0 commit comments

Comments
 (0)