From 70642877ca8fdc75a32e1834f91c3d805cf61d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Misty=20De=20M=C3=A9o?= Date: Wed, 28 Aug 2024 10:18:15 -0700 Subject: [PATCH] feat: powershell respects NoModifyPath from env This is supported from the environment in the shell installer, but was previously only supported on the CLI in the powershell installer. This will be useful to ensure axoupdater tests don't pollute the environment: https://github.com/axodotdev/axoupdater/pull/168 refs #1374. --- cargo-dist/templates/installer/installer.ps1.j2 | 5 +++++ cargo-dist/tests/snapshots/akaikatana_basic.snap | 5 +++++ .../akaikatana_one_alias_among_many_binaries.snap | 5 +++++ .../tests/snapshots/akaikatana_two_bin_aliases.snap | 5 +++++ cargo-dist/tests/snapshots/akaikatana_updaters.snap | 5 +++++ cargo-dist/tests/snapshots/axolotlsay_abyss.snap | 5 +++++ cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap | 5 +++++ cargo-dist/tests/snapshots/axolotlsay_alias.snap | 5 +++++ .../axolotlsay_alias_ignores_missing_bins.snap | 5 +++++ cargo-dist/tests/snapshots/axolotlsay_basic.snap | 5 +++++ cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap | 5 +++++ .../tests/snapshots/axolotlsay_build_setup_steps.snap | 5 +++++ .../snapshots/axolotlsay_disable_source_tarball.snap | 5 +++++ .../tests/snapshots/axolotlsay_edit_existing.snap | 5 +++++ .../snapshots/axolotlsay_generic_workspace_basic.snap | 10 ++++++++++ .../tests/snapshots/axolotlsay_homebrew_packages.snap | 5 +++++ .../snapshots/axolotlsay_no_homebrew_publish.snap | 5 +++++ .../tests/snapshots/axolotlsay_several_aliases.snap | 5 +++++ .../snapshots/axolotlsay_ssldotcom_windows_sign.snap | 5 +++++ .../axolotlsay_ssldotcom_windows_sign_prod.snap | 5 +++++ cargo-dist/tests/snapshots/axolotlsay_updaters.snap | 5 +++++ .../snapshots/axolotlsay_user_global_build_job.snap | 5 +++++ .../tests/snapshots/axolotlsay_user_host_job.snap | 5 +++++ .../snapshots/axolotlsay_user_local_build_job.snap | 5 +++++ .../tests/snapshots/axolotlsay_user_plan_job.snap | 5 +++++ .../tests/snapshots/axolotlsay_user_publish_job.snap | 5 +++++ .../tests/snapshots/install_path_cargo_home.snap | 5 +++++ .../tests/snapshots/install_path_env_no_subdir.snap | 5 +++++ .../tests/snapshots/install_path_env_subdir.snap | 5 +++++ .../tests/snapshots/install_path_env_subdir_space.snap | 5 +++++ .../install_path_env_subdir_space_deeper.snap | 5 +++++ .../install_path_fallback_no_env_var_set.snap | 5 +++++ .../snapshots/install_path_home_subdir_deeper.snap | 5 +++++ .../tests/snapshots/install_path_home_subdir_min.snap | 5 +++++ .../snapshots/install_path_home_subdir_space.snap | 5 +++++ .../install_path_home_subdir_space_deeper.snap | 5 +++++ .../snapshots/install_path_no_fallback_taken.snap | 5 +++++ 37 files changed, 190 insertions(+) diff --git a/cargo-dist/templates/installer/installer.ps1.j2 b/cargo-dist/templates/installer/installer.ps1.j2 index e4bed5103..a4eb04a5c 100644 --- a/cargo-dist/templates/installer/installer.ps1.j2 +++ b/cargo-dist/templates/installer/installer.ps1.j2 @@ -359,6 +359,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/{{ app_name }}-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "{{ install_success_msg }}" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/akaikatana_basic.snap b/cargo-dist/tests/snapshots/akaikatana_basic.snap index b56c9031f..36e435e52 100644 --- a/cargo-dist/tests/snapshots/akaikatana_basic.snap +++ b/cargo-dist/tests/snapshots/akaikatana_basic.snap @@ -1516,6 +1516,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/akaikatana-repack-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/akaikatana_one_alias_among_many_binaries.snap b/cargo-dist/tests/snapshots/akaikatana_one_alias_among_many_binaries.snap index dc32bfe47..b1e6e8a19 100644 --- a/cargo-dist/tests/snapshots/akaikatana_one_alias_among_many_binaries.snap +++ b/cargo-dist/tests/snapshots/akaikatana_one_alias_among_many_binaries.snap @@ -1546,6 +1546,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/akaikatana-repack-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/akaikatana_two_bin_aliases.snap b/cargo-dist/tests/snapshots/akaikatana_two_bin_aliases.snap index 0a41e3b18..11ecf9652 100644 --- a/cargo-dist/tests/snapshots/akaikatana_two_bin_aliases.snap +++ b/cargo-dist/tests/snapshots/akaikatana_two_bin_aliases.snap @@ -1572,6 +1572,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/akaikatana-repack-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/akaikatana_updaters.snap b/cargo-dist/tests/snapshots/akaikatana_updaters.snap index e0e1ab71a..e8ecd5d3b 100644 --- a/cargo-dist/tests/snapshots/akaikatana_updaters.snap +++ b/cargo-dist/tests/snapshots/akaikatana_updaters.snap @@ -1524,6 +1524,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/akaikatana-repack-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_abyss.snap b/cargo-dist/tests/snapshots/axolotlsay_abyss.snap index 8e2005b58..dc0cdb0a0 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_abyss.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_abyss.snap @@ -1516,6 +1516,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap b/cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap index 003c40efd..a9b653bac 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap @@ -1516,6 +1516,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_alias.snap b/cargo-dist/tests/snapshots/axolotlsay_alias.snap index 277ab1bd2..9664b4eef 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_alias.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_alias.snap @@ -1546,6 +1546,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_alias_ignores_missing_bins.snap b/cargo-dist/tests/snapshots/axolotlsay_alias_ignores_missing_bins.snap index 4c7423c4c..149ebb93c 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_alias_ignores_missing_bins.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_alias_ignores_missing_bins.snap @@ -1550,6 +1550,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_basic.snap b/cargo-dist/tests/snapshots/axolotlsay_basic.snap index 1fb4d5b65..a3beb7384 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_basic.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_basic.snap @@ -1516,6 +1516,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information ">o_o< everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap b/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap index 1f130f1c6..b7a0bfa97 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap @@ -1519,6 +1519,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_build_setup_steps.snap b/cargo-dist/tests/snapshots/axolotlsay_build_setup_steps.snap index e64a073c8..83ba59074 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_build_setup_steps.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_build_setup_steps.snap @@ -1516,6 +1516,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information ">o_o< everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_disable_source_tarball.snap b/cargo-dist/tests/snapshots/axolotlsay_disable_source_tarball.snap index d297ea68a..8f6baf36c 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_disable_source_tarball.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_disable_source_tarball.snap @@ -1516,6 +1516,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap b/cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap index edf995030..0c024c7fc 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap @@ -1516,6 +1516,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_generic_workspace_basic.snap b/cargo-dist/tests/snapshots/axolotlsay_generic_workspace_basic.snap index f9a15c5ec..b3cf4c686 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_generic_workspace_basic.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_generic_workspace_basic.snap @@ -1515,6 +1515,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-js-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information ">o_o< everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir @@ -3158,6 +3163,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information ">o_o< everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_homebrew_packages.snap b/cargo-dist/tests/snapshots/axolotlsay_homebrew_packages.snap index bdad7da0a..47569c5b8 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_homebrew_packages.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_homebrew_packages.snap @@ -1516,6 +1516,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_no_homebrew_publish.snap b/cargo-dist/tests/snapshots/axolotlsay_no_homebrew_publish.snap index 50d77dbef..96793f9d9 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_no_homebrew_publish.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_no_homebrew_publish.snap @@ -1516,6 +1516,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_several_aliases.snap b/cargo-dist/tests/snapshots/axolotlsay_several_aliases.snap index 86e73a6ab..cdac80917 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_several_aliases.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_several_aliases.snap @@ -1550,6 +1550,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign.snap b/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign.snap index a26756562..acee07652 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign.snap @@ -1451,6 +1451,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign_prod.snap b/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign_prod.snap index a26756562..acee07652 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign_prod.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign_prod.snap @@ -1451,6 +1451,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_updaters.snap b/cargo-dist/tests/snapshots/axolotlsay_updaters.snap index e4a8884a7..61954d4b6 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_updaters.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_updaters.snap @@ -1524,6 +1524,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_global_build_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_global_build_job.snap index ea8b8a7ee..c28565910 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_global_build_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_global_build_job.snap @@ -1516,6 +1516,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_host_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_host_job.snap index 4f6121cd8..50950d3e3 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_host_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_host_job.snap @@ -1516,6 +1516,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_local_build_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_local_build_job.snap index be3f107e6..89eabf6d5 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_local_build_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_local_build_job.snap @@ -1516,6 +1516,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_plan_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_plan_job.snap index f4672364a..aa64c964d 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_plan_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_plan_job.snap @@ -1516,6 +1516,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_publish_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_publish_job.snap index 7725c3543..d09c00de2 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_publish_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_publish_job.snap @@ -1516,6 +1516,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/install_path_cargo_home.snap b/cargo-dist/tests/snapshots/install_path_cargo_home.snap index 59ca71f3c..5994b1a7a 100644 --- a/cargo-dist/tests/snapshots/install_path_cargo_home.snap +++ b/cargo-dist/tests/snapshots/install_path_cargo_home.snap @@ -1516,6 +1516,11 @@ function Invoke-Installer($artifacts, $platforms) { $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/install_path_env_no_subdir.snap b/cargo-dist/tests/snapshots/install_path_env_no_subdir.snap index d9e5ce7ff..22abe0c8e 100644 --- a/cargo-dist/tests/snapshots/install_path_env_no_subdir.snap +++ b/cargo-dist/tests/snapshots/install_path_env_no_subdir.snap @@ -1491,6 +1491,11 @@ $dest_dir = $env:CARGO_DIST_FORCE_INSTALL_DIR $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/install_path_env_subdir.snap b/cargo-dist/tests/snapshots/install_path_env_subdir.snap index c71e0eb8c..3dec3a9db 100644 --- a/cargo-dist/tests/snapshots/install_path_env_subdir.snap +++ b/cargo-dist/tests/snapshots/install_path_env_subdir.snap @@ -1491,6 +1491,11 @@ $dest_dir = $env:CARGO_DIST_FORCE_INSTALL_DIR $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/install_path_env_subdir_space.snap b/cargo-dist/tests/snapshots/install_path_env_subdir_space.snap index d57b13fcf..a6c27b7a0 100644 --- a/cargo-dist/tests/snapshots/install_path_env_subdir_space.snap +++ b/cargo-dist/tests/snapshots/install_path_env_subdir_space.snap @@ -1491,6 +1491,11 @@ $dest_dir = $env:CARGO_DIST_FORCE_INSTALL_DIR $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/install_path_env_subdir_space_deeper.snap b/cargo-dist/tests/snapshots/install_path_env_subdir_space_deeper.snap index ad4091e9a..3ba4c8460 100644 --- a/cargo-dist/tests/snapshots/install_path_env_subdir_space_deeper.snap +++ b/cargo-dist/tests/snapshots/install_path_env_subdir_space_deeper.snap @@ -1491,6 +1491,11 @@ $dest_dir = $env:CARGO_DIST_FORCE_INSTALL_DIR $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/install_path_fallback_no_env_var_set.snap b/cargo-dist/tests/snapshots/install_path_fallback_no_env_var_set.snap index 26fe6ded8..d9f313f91 100644 --- a/cargo-dist/tests/snapshots/install_path_fallback_no_env_var_set.snap +++ b/cargo-dist/tests/snapshots/install_path_fallback_no_env_var_set.snap @@ -1512,6 +1512,11 @@ $dest_dir = $env:CARGO_DIST_FORCE_INSTALL_DIR $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/install_path_home_subdir_deeper.snap b/cargo-dist/tests/snapshots/install_path_home_subdir_deeper.snap index defe98305..49a5cac96 100644 --- a/cargo-dist/tests/snapshots/install_path_home_subdir_deeper.snap +++ b/cargo-dist/tests/snapshots/install_path_home_subdir_deeper.snap @@ -1491,6 +1491,11 @@ $dest_dir = $env:CARGO_DIST_FORCE_INSTALL_DIR $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/install_path_home_subdir_min.snap b/cargo-dist/tests/snapshots/install_path_home_subdir_min.snap index 6d2de3ab4..dec9734b5 100644 --- a/cargo-dist/tests/snapshots/install_path_home_subdir_min.snap +++ b/cargo-dist/tests/snapshots/install_path_home_subdir_min.snap @@ -1491,6 +1491,11 @@ $dest_dir = $env:CARGO_DIST_FORCE_INSTALL_DIR $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/install_path_home_subdir_space.snap b/cargo-dist/tests/snapshots/install_path_home_subdir_space.snap index a29b521bc..b5c02d0aa 100644 --- a/cargo-dist/tests/snapshots/install_path_home_subdir_space.snap +++ b/cargo-dist/tests/snapshots/install_path_home_subdir_space.snap @@ -1491,6 +1491,11 @@ $dest_dir = $env:CARGO_DIST_FORCE_INSTALL_DIR $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/install_path_home_subdir_space_deeper.snap b/cargo-dist/tests/snapshots/install_path_home_subdir_space_deeper.snap index 992a56201..d94c292f9 100644 --- a/cargo-dist/tests/snapshots/install_path_home_subdir_space_deeper.snap +++ b/cargo-dist/tests/snapshots/install_path_home_subdir_space_deeper.snap @@ -1491,6 +1491,11 @@ $dest_dir = $env:CARGO_DIST_FORCE_INSTALL_DIR $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir diff --git a/cargo-dist/tests/snapshots/install_path_no_fallback_taken.snap b/cargo-dist/tests/snapshots/install_path_no_fallback_taken.snap index 7d04ba7dd..3a6d19323 100644 --- a/cargo-dist/tests/snapshots/install_path_no_fallback_taken.snap +++ b/cargo-dist/tests/snapshots/install_path_no_fallback_taken.snap @@ -1512,6 +1512,11 @@ $dest_dir = $env:CARGO_DIST_FORCE_INSTALL_DIR $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) + # Respect the environment, but CLI takes precedence + if ($null -eq $NoModifyPath) { + $NoModifyPath = $env:INSTALLER_NO_MODIFY_PATH + } + Write-Information "everything's installed!" if (-not $NoModifyPath) { Add-Ci-Path $dest_dir