mirror of
https://github.com/cmderdev/cmder.git
synced 2025-06-13 13:17:55 +08:00
allow git prompt status opt out for powershell and bash
This commit is contained in:
14
vendor/psmodules/Cmder.ps1
vendored
14
vendor/psmodules/Cmder.ps1
vendored
@ -32,7 +32,11 @@ function checkGit($Path) {
|
||||
if($env:gitLoaded -eq 'false') {
|
||||
$env:gitLoaded = Import-Git
|
||||
}
|
||||
Write-VcsStatus
|
||||
|
||||
if (getGitStatusSetting -eq $true) {
|
||||
Write-VcsStatus
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
$SplitPath = split-path $path
|
||||
@ -41,4 +45,12 @@ function checkGit($Path) {
|
||||
}
|
||||
}
|
||||
|
||||
function getGitStatusSetting() {
|
||||
$gitStatus = (git config cmder.status) | out-string
|
||||
|
||||
if (($gitStatus -replace "`n" -replace "`r") -eq "false") {
|
||||
return $false
|
||||
} else {
|
||||
return $true
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user