mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-14 07:29:12 +08:00
adjust indentation and merge from main
This commit is contained in:
commit
4740b836f3
7
vendor/lib/lib_git.cmd
vendored
7
vendor/lib/lib_git.cmd
vendored
@ -187,6 +187,11 @@ exit /b
|
||||
:::===============================================================================
|
||||
:::is_git_shim - Check if the directory has a git.shim file
|
||||
:::.
|
||||
:::description:
|
||||
:::.
|
||||
::: Shim is a small helper program for Scoop that calls the executable configured in git.shim file
|
||||
::: See: github.com/ScoopInstaller/Shim and github.com/cmderdev/cmder/pull/1905
|
||||
:::.
|
||||
:::include:
|
||||
:::.
|
||||
::: call "$0"
|
||||
@ -202,7 +207,7 @@ exit /b
|
||||
|
||||
:is_git_shim
|
||||
pushd "%~1"
|
||||
:: check if there's shim - and if yes follow the path
|
||||
:: check if there is a shim file - if yes, read the actual executable path
|
||||
setlocal enabledelayedexpansion
|
||||
if exist git.shim (
|
||||
for /F "tokens=2 delims== " %%I in (git.shim) do (
|
||||
|
35
vendor/psmodules/Cmder.ps1
vendored
35
vendor/psmodules/Cmder.ps1
vendored
@ -18,7 +18,8 @@ function readVersion($gitPath) {
|
||||
}
|
||||
|
||||
function isGitShim($gitPath) {
|
||||
# check if there's shim - and if yes follow the path
|
||||
# check if there is a shim file - if yes, read the actual executable path
|
||||
# See: github.com/ScoopInstaller/Shim
|
||||
|
||||
if (Test-Path "${gitPath}\git.shim") {
|
||||
$shim = (get-content "${gitPath}\git.shim")
|
||||
@ -178,27 +179,27 @@ function getGitStatusSetting() {
|
||||
}
|
||||
|
||||
function yOrn( $question ) {
|
||||
Do {
|
||||
$Answer = Read-Host -Prompt "`n${question}? (y/n) "
|
||||
}
|
||||
Until ($Answer -eq 'y' -or $Answer -eq 'n' -or $Answer -eq 'yes' -or $Answer -eq 'no')
|
||||
Do {
|
||||
$Answer = Read-Host -Prompt "`n${question}? (y/n) "
|
||||
}
|
||||
Until ($Answer -eq 'y' -or $Answer -eq 'n' -or $Answer -eq 'yes' -or $Answer -eq 'no')
|
||||
|
||||
return $Answer
|
||||
return $Answer
|
||||
}
|
||||
|
||||
function templateExpand($template_filename, $outfile) {
|
||||
$template = Get-Content "$template_filename" -Raw
|
||||
$template = Get-Content "$template_filename" -Raw
|
||||
|
||||
$expanded = Invoke-Expression "@`"`r`n$template`r`n`"@"
|
||||
$expanded = Invoke-Expression "@`"`r`n$template`r`n`"@"
|
||||
|
||||
$overwrite = 'y'
|
||||
if ((test-path "$outfile")) {
|
||||
$overwrite = yOrn "'$outfile' already exists do you want to overwrite it"
|
||||
}
|
||||
$overwrite = 'y'
|
||||
if ((test-path "$outfile")) {
|
||||
$overwrite = yOrn "'$outfile' already exists do you want to overwrite it"
|
||||
}
|
||||
|
||||
if ($overwrite -match 'y') {
|
||||
$expanded | out-file -ErrorAction silentlycontinue -encoding ascii "$outfile"
|
||||
} else {
|
||||
write-host "Skipping Cmder '$shell' config generation at user request!"
|
||||
}
|
||||
if ($overwrite -match 'y') {
|
||||
$expanded | out-file -ErrorAction silentlycontinue -encoding ascii "$outfile"
|
||||
} else {
|
||||
write-host "Skipping Cmder '$shell' config generation at user request!"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user