Skip to content

Commit

Permalink
fix(install): 'env_add_path' doesn't append '.' (ScoopInstaller#4550)
Browse files Browse the repository at this point in the history
  • Loading branch information
niheaven authored and se35710 committed Mar 8, 2022
1 parent 3840180 commit a1cdda0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/install.ps1
Expand Up @@ -988,11 +988,16 @@ function find_dir_or_subdir($path, $dir) {

function env_add_path($manifest, $dir, $global, $arch) {
$env_add_path = arch_specific 'env_add_path' $manifest $arch
$dir = $dir.TrimEnd('\')
if ($env_add_path) {
# GH-3785: Add path in ascending order.
[Array]::Reverse($env_add_path)
$env_add_path | Where-Object { $_ } | ForEach-Object {
$path_dir = Join-Path $dir $_
if ($_ -eq '.') {
$path_dir = $dir
} else {
$path_dir = Join-Path $dir $_
}

if (!(is_in_dir $dir $path_dir)) {
abort "Error in manifest: env_add_path '$_' is outside the app directory."
Expand Down

0 comments on commit a1cdda0

Please sign in to comment.