Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4000, handle arch-specific env_add_path #4013

Merged
merged 8 commits into from
Nov 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/uninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ function do_uninstall($app, $global) {
# directory.
$refdir = unlink_current (appdir $app $global)

env_rm_path $manifest $refdir $global
env_rm $manifest $global
env_rm_path $manifest $refdir $global $architecture
env_rm $manifest $global $architecture

$appdir = appdir $app $global
try {
Expand Down
15 changes: 8 additions & 7 deletions libexec/scoop-info.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -107,25 +107,26 @@ if($binaries) {
}
Write-Output $binary_output
}

if($manifest.env_set -or $manifest.env_add_path) {
$env_set = (arch_specific 'env_set' $manifest $install.architecture)
$env_add_path = (arch_specific 'env_add_path' $manifest $install.architecture)
if($env_set -or $env_add_path) {
if($status.installed) {
Write-Output "Environment:"
} else {
Write-Output "Environment: (simulated)"
}
}
if($manifest.env_set) {
$manifest.env_set | Get-Member -member noteproperty | ForEach-Object {
if($env_set) {
$env_set | Get-Member -member noteproperty | ForEach-Object {
$value = env $_.name $global
if(!$value) {
$value = format $manifest.env_set.$($_.name) @{ "dir" = $dir }
$value = format $env_set.$($_.name) @{ "dir" = $dir }
}
Write-Output " $($_.name)=$value"
}
}
if($manifest.env_add_path) {
$manifest.env_add_path | Where-Object { $_ } | ForEach-Object {
if($env_add_path) {
$env_add_path | Where-Object { $_ } | ForEach-Object {
if($_ -eq '.') {
Write-Output " PATH=%PATH%;$dir"
} else {
Expand Down
4 changes: 2 additions & 2 deletions libexec/scoop-reset.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ $apps | ForEach-Object {
$dir = link_current $dir
create_shims $manifest $dir $global $architecture
create_startmenu_shortcuts $manifest $dir $global $architecture
env_add_path $manifest $dir
env_set $manifest $dir $global
env_add_path $manifest $dir $global $architecture
env_set $manifest $dir $global $architecture
# unlink all potential old link before re-persisting
unlink_persist_data $original_dir
persist_data $manifest $original_dir $persist_dir
Expand Down
4 changes: 2 additions & 2 deletions libexec/scoop-uninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ if (!$apps) { exit 0 }

uninstall_psmodule $manifest $refdir $global

env_rm_path $manifest $refdir $global
env_rm $manifest $global
env_rm_path $manifest $refdir $global $architecture
env_rm $manifest $global $architecture

try {
# unlink all potential old link before doing recursive Remove-Item
Expand Down
4 changes: 2 additions & 2 deletions libexec/scoop-update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ function update($app, $global, $quiet = $false, $independent, $suggested, $use_c
write-host "Uninstalling '$app' ($old_version)"
run_uninstaller $old_manifest $architecture $dir
rm_shims $old_manifest $global $architecture
env_rm_path $old_manifest $dir $global
env_rm $old_manifest $global
env_rm_path $old_manifest $dir $global $architecture
env_rm $old_manifest $global $architecture

# If a junction was used during install, that will have been used
# as the reference directory. Otherwise it will just be the version
Expand Down
4 changes: 2 additions & 2 deletions supporting/shims/kiennq/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*.zip
*.bak
*.zip
*.bak