Skip to content

Commit

Permalink
Merge pull request #722 from dahlbyk/rkeithhill/do-not-create-home-en…
Browse files Browse the repository at this point in the history
…v-var

Fix #718 do not create HOME env var
  • Loading branch information
rkeithhill authored Dec 7, 2019
2 parents 2ad9463 + 869fff9 commit 8115fe5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/posh-git.psm1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
param([switch]$ForcePoshGitPrompt)
param([bool]$ForcePoshGitPrompt)

. $PSScriptRoot\CheckRequirements.ps1 > $null

Expand All @@ -13,9 +13,6 @@ param([switch]$ForcePoshGitPrompt)
. $PSScriptRoot\GitTabExpansion.ps1
. $PSScriptRoot\TortoiseGit.ps1

if (!$Env:HOME) { $Env:HOME = "$Env:HOMEDRIVE$Env:HOMEPATH" }
if (!$Env:HOME) { $Env:HOME = "$Env:USERPROFILE" }

$IsAdmin = Test-Administrator

# Get the default prompt definition.
Expand Down
4 changes: 2 additions & 2 deletions test/DefaultPrompt.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Describe 'Default Prompt Tests - NO ANSI' {

Context 'Prompt with no Git summary' {
It 'Returns the expected prompt string' {
Set-Location $env:HOME -ErrorAction Stop
Set-Location $HOME -ErrorAction Stop
$res = [string](&$prompt *>&1)
$res | Should BeExactly "$(Get-PromptConnectionInfo)$(GetHomePath)> "
}
Expand Down Expand Up @@ -152,7 +152,7 @@ Describe 'Default Prompt Tests - ANSI' {

Context 'Prompt with no Git summary' {
It 'Returns the expected prompt string' {
Set-Location $env:HOME -ErrorAction Stop
Set-Location $HOME -ErrorAction Stop
$res = &$prompt
$res | Should BeExactly "$(Get-PromptConnectionInfo)$(GetHomePath)> "
}
Expand Down

0 comments on commit 8115fe5

Please sign in to comment.