Skip to content

Commit

Permalink
restore apps/*/current links if they are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed Mar 28, 2024
1 parent f9b72aa commit 3d1ac52
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scoop-portable.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,10 @@ goto :eof
if ($app_name -eq 'scoop') { return; } ^
$app_manifest = Get-Content -path "%SCOOP%\.portable\active_versions\$app_name.json" -raw ^| ConvertFrom-Json; ^
$app_curr_ver = $app_manifest.version; ^
fsutil reparsepoint delete $app_curr_ver_path ^| out-null; ^
Remove-Item $app_curr_ver_path -recurse -force; ^
if (Test-Path -Path $app_curr_ver_path) { ^
fsutil reparsepoint delete $app_curr_ver_path ^| out-null; ^
Remove-Item $app_curr_ver_path -recurse -force; ^
} ^
New-Item -itemType Junction -path $app_curr_ver_path -target "%SCOOP%\apps\$app_name\$app_curr_ver" ^| out-null; ^
Write-Host "[$(Get-Date -Format 'HH:mm:ss,ff')] --^> Junction updated: $app_curr_ver_path"; ^
^
Expand All @@ -322,6 +324,7 @@ goto :eof
} ^
^
Get-ChildItem '%SCOOP%\apps\*\*' -directory -filter current ^| Foreach-Object { fixAppCurrentVersionSymlinks $_ }; ^
Get-ChildItem '%SCOOP%\apps\*' -directory ^| Where-Object { -not (Test-Path '$_\current') } ^| Foreach-Object { fixAppCurrentVersionSymlinks ([System.IO.DirectoryInfo](Join-Path $_.FullName 'current')) }; ^
#

powershell -noprofile -ex unrestricted -command "%fix_paths%" || exit /B 1
Expand Down

0 comments on commit 3d1ac52

Please sign in to comment.