@@ -78,10 +78,10 @@ param(
7878
7979if ($App -ne ' *' -and (Test-Path $App - PathType Leaf)) {
8080 $Dir = Split-Path $App
81- $files = Get-ChildItem $Dir (Split-Path $App - Leaf)
81+ $files = Get-ChildItem $Dir - Filter (Split-Path $App - Leaf)
8282} elseif ($Dir ) {
8383 $Dir = Convert-Path $Dir
84- $files = Get-ChildItem $Dir " $App .json"
84+ $files = Get-ChildItem $Dir - Filter " $App .json" - Recurse
8585} else {
8686 throw " '-Dir' parameter required if '-App' is not a filepath!"
8787}
@@ -97,9 +97,10 @@ if ($App -eq '*' -and $Version -ne '') {
9797$Queue = @ ()
9898$json = ' '
9999$files | ForEach-Object {
100- $json = parse_json " $Dir \$ ( $_.Name ) "
100+ $file = $_.FullName
101+ $json = parse_json $file
101102 if ($json.checkver ) {
102- $Queue += , @ ($_.Name , $json )
103+ $Queue += , @ ($_.BaseName , $json , $file )
103104 }
104105}
105106
@@ -109,7 +110,7 @@ Get-EventSubscriber | Unregister-Event
109110
110111# start all downloads
111112$Queue | ForEach-Object {
112- $name , $json = $_
113+ $name , $json , $file = $_
113114
114115 $substitutions = Get-VersionSubstitution $json.version # 'autoupdate.ps1'
115116
@@ -226,7 +227,8 @@ $Queue | ForEach-Object {
226227 $url = substitute $url $substitutions
227228
228229 $state = New-Object psobject @ {
229- app = (strip_ext $name );
230+ app = $name ;
231+ file = $file ;
230232 url = $url ;
231233 regex = $regex ;
232234 json = $json ;
@@ -254,6 +256,7 @@ while ($in_progress -gt 0) {
254256
255257 $state = $ev.SourceEventArgs.UserState
256258 $app = $state.app
259+ $file = $state.file
257260 $json = $state.json
258261 $url = $state.url
259262 $regexp = $state.regex
@@ -360,7 +363,7 @@ while ($in_progress -gt 0) {
360363 # Skip actual only if versions are same and there is no -f
361364 if (($ver -eq $expected_ver ) -and ! $ForceUpdate -and $SkipUpdated ) { continue }
362365
363- Write-Host " $App `: " - NoNewline
366+ Write-Host " $app `: " - NoNewline
364367
365368 # version hasn't changed (step over if forced update)
366369 if ($ver -eq $expected_ver -and ! $ForceUpdate ) {
@@ -386,7 +389,7 @@ while ($in_progress -gt 0) {
386389 Write-Host ' Forcing autoupdate!' - ForegroundColor DarkMagenta
387390 }
388391 try {
389- Invoke-AutoUpdate $App $Dir $json $ver $matchesHashtable # 'autoupdate.ps1'
392+ Invoke-AutoUpdate $app $file $json $ver $matchesHashtable # 'autoupdate.ps1'
390393 } catch {
391394 if ($ThrowError ) {
392395 throw $_
0 commit comments