Skip to content

Commit

Permalink
Add handling for non-standard $PROFILE
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlbyk committed Jan 31, 2017
1 parent c9c1b52 commit 4c8cbc6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,15 @@ function Add-PoshGitToProfile([switch]$AllHosts, [switch]$Force, [switch]$WhatIf
}
}

if (!$profilePath) { $profilePath = $PROFILE }

if (!$Force) {
# Search the user's profiles to see if any are using posh-git already, there is an extra search
# ($profilePath) taking place to accomodate the Pester tests.
$importedInProfile = Test-PoshGitImportedInScript $profilePath
if (!$importedInProfile -and !$underTest) {
$importedInProfile = Test-PoshGitImportedInScript $PROFILE
}
if (!$importedInProfile -and !$underTest) {
$importedInProfile = Test-PoshGitImportedInScript $PROFILE.CurrentUserCurrentHost
}
Expand Down

0 comments on commit 4c8cbc6

Please sign in to comment.