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

Consistent and idiomatic casing/formatting. #33362

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Changes from 1 commit
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
13 changes: 6 additions & 7 deletions activate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@
#

function deactivate ([switch]$init) {

# reset old environment variables
if (Test-Path variable:_OLD_PATH) {
$env:PATH = $_OLD_PATH
Remove-Item variable:_OLD_PATH
}

if (test-path function:_old_prompt) {
Set-Item Function:prompt -Value $function:_old_prompt -ea ignore
remove-item function:_old_prompt
Set-Item Function:prompt -Value $function:_old_prompt -ErrorAction Ignore
Remove-Item function:_old_prompt
}

Remove-Item env:DOTNET_ROOT -ea ignore
Remove-Item env:DOTNET_MULTILEVEL_LOOKUP -ea ignore
Remove-Item env:DOTNET_ROOT -ErrorAction Ignore
Remove-Item env:DOTNET_MULTILEVEL_LOOKUP -ErrorAction Ignore
if (-not $init) {
# Remove the deactivate function
Remove-Item function:deactivate
Expand All @@ -41,11 +40,11 @@ if (-not $env:DISABLE_CUSTOM_PROMPT) {
$function:_old_prompt = $function:prompt
function dotnet_prompt {
# Add a prefix to the current prompt, but don't discard it.
write-host "($( split-path $PSScriptRoot -leaf )) " -nonewline
Write-Host "($(Split-Path $PSScriptRoot -Leaf)) " -NoNewLine
& $function:_old_prompt
}

Set-Item Function:prompt -Value $function:dotnet_prompt -ea ignore
Set-Item Function:prompt -Value $function:dotnet_prompt -ErrorAction Ignore
}

Write-Host -f Magenta "Enabled the .NET Core environment. Execute 'deactivate' to exit."
Expand Down
Loading