diff --git a/vendor/lib/lib_git.cmd b/vendor/lib/lib_git.cmd index 58d2f19fa..7b3bc4766 100644 --- a/vendor/lib/lib_git.cmd +++ b/vendor/lib/lib_git.cmd @@ -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 ( diff --git a/vendor/psmodules/Cmder.ps1 b/vendor/psmodules/Cmder.ps1 index 79a053fce..c9a11df93 100644 --- a/vendor/psmodules/Cmder.ps1 +++ b/vendor/psmodules/Cmder.ps1 @@ -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!" + } }