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 Feb 1, 2017
1 parent 7d0753d commit 9a178d1
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 9a178d1

Please sign in to comment.