separate powershell functions from profile.ps1

This commit is contained in:
Dax T. Games 2019-11-03 13:07:20 -05:00
parent dac4b27e28
commit 6ab4599a4d
2 changed files with 2 additions and 3 deletions

1
vendor/profile.ps1 vendored
View File

@ -57,7 +57,6 @@ if (Get-Module PSReadline -ErrorAction "SilentlyContinue") {
} }
# Pre assign default prompt hooks so the first run of cmder gets a working prompt. # Pre assign default prompt hooks so the first run of cmder gets a working prompt.
$gitLoaded = $false
$env:gitLoaded = $false $env:gitLoaded = $false
[ScriptBlock]$PrePrompt = {} [ScriptBlock]$PrePrompt = {}
[ScriptBlock]$PostPrompt = {} [ScriptBlock]$PostPrompt = {}

View File

@ -15,7 +15,7 @@ function Configure-Git($GIT_INSTALL_ROOT){
} }
} }
function Import-Git($Loaded){ function Import-Git(){
$GitModule = Get-Module -Name Posh-Git -ListAvailable $GitModule = Get-Module -Name Posh-Git -ListAvailable
if($GitModule | select version | where version -le ([version]"0.6.1.20160330")){ if($GitModule | select version | where version -le ([version]"0.6.1.20160330")){
Import-Module Posh-Git > $null Import-Module Posh-Git > $null
@ -30,7 +30,7 @@ function Import-Git($Loaded){
function checkGit($Path) { function checkGit($Path) {
if (Test-Path -Path (Join-Path $Path '.git') ) { if (Test-Path -Path (Join-Path $Path '.git') ) {
if($env:gitLoaded -eq 'false') { if($env:gitLoaded -eq 'false') {
$env:gitLoaded = Import-Git $gitLoaded $env:gitLoaded = Import-Git
} }
Write-VcsStatus Write-VcsStatus
return return