mirror of
https://github.com/cmderdev/cmder.git
synced 2025-02-10 23:49:07 +08:00
separate powershell functions from profile.ps1
This commit is contained in:
parent
dac4b27e28
commit
6ab4599a4d
1
vendor/profile.ps1
vendored
1
vendor/profile.ps1
vendored
@ -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 = {}
|
||||||
|
4
vendor/psmodules/Cmder.ps1
vendored
4
vendor/psmodules/Cmder.ps1
vendored
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user