diff --git a/envr.ps1 b/envr.ps1 index 666690e..7cdc69d 100644 --- a/envr.ps1 +++ b/envr.ps1 @@ -1,4 +1,4 @@ -# envr v0.5.5 +# envr v0.5.6 # https://www.github.com/JPHutchins/envr # https://www.crumpledpaper.tech @@ -529,7 +529,15 @@ function global:unsource ([switch]$NonDestructive) { if (Get-Variable -Name "ENVR_ROOT" -ErrorAction SilentlyContinue) { Remove-Variable -Name ENVR_ROOT -Scope Global -Force - } + } + + # Remove project options: + if (Test-Path -Path env:ENVR_ROOT) { + Remove-Item -Path env:ENVR_ROOT + } + if (Test-Path -Path env:ENVR_PROJECT_NAME) { + Remove-Item -Path env:ENVR_PROJECT_NAME + } # Remove variables leftover from script run # $_VAR_REMOVE_LIST = diff --git a/tests/sh/test_project_options.sh b/tests/sh/test_project_options.sh index 88ca7c5..e6632bc 100644 --- a/tests/sh/test_project_options.sh +++ b/tests/sh/test_project_options.sh @@ -25,5 +25,7 @@ unsource assertEqual "$OLD_PATH" "$PATH" assertEqual "$OLD_ALS" "$(alias)" +assertEqual "" "$ENVR_PROJECT_NAME" +assertEqual "" "$ENVR_ROOT" exit $RES \ No newline at end of file diff --git a/tests/windows/test_project_options.ps1 b/tests/windows/test_project_options.ps1 index fd6a450..4d52de1 100644 --- a/tests/windows/test_project_options.ps1 +++ b/tests/windows/test_project_options.ps1 @@ -16,5 +16,8 @@ function global:project_options () { $PS1_OUT = prompt 6>&1 $TEST_RES += assertEqual $OLD_PS1_OUT $PS1_OUT + $TEST_RES += assertEqual $null $env:ENVR_PROJECT_NAME + $TEST_RES += assertEqual $null $env:ENVR_ROOT + return $TEST_RES } \ No newline at end of file