Merge remote-tracking branch 'upstream/development' into development-dax

* upstream/development:
This commit is contained in:
Dax T. Games
2024-12-29 16:10:48 -05:00
2 changed files with 30 additions and 30 deletions

View File

@@ -149,8 +149,8 @@ exit /b
exit /b exit /b
:enhance_path_recursive :enhance_path_recursive
call :set_path_recursive "%~1" "%~2" "%~3" call :set_path_recursive "%~1" "%~2" "%~3"
exit /b exit /b
:set_path_recursive :set_path_recursive
:::=============================================================================== :::===============================================================================
@@ -206,9 +206,9 @@ exit /b
if "%fast_init%" == "1" ( if "%fast_init%" == "1" (
if "%add_to_path%" neq "" ( if "%add_to_path%" neq "" (
if "%position%" == "append" ( if "%position%" == "append" (
set "path=%path%;%add_to_path%" set "path=%path%;%add_to_path%"
) else ( ) else (
set "path=%add_to_path%;%path%" set "path=%add_to_path%;%path%"
) )
) )
) )
@@ -218,18 +218,18 @@ exit /b
exit /b exit /b
) )
%print_debug% :enhance_path_recursive "Env Var - add_path=%add_to_path%" %print_debug% :set_path_recursive "Env Var - add_path=%add_to_path%"
%print_debug% :enhance_path_recursive "Env Var - position=%position%" %print_debug% :set_path_recursive "Env Var - position=%position%"
%print_debug% :enhance_path_recursive "Env Var - depth=%depth%" %print_debug% :set_path_recursive "Env Var - depth=%depth%"
%print_debug% :enhance_path_recursive "Env Var - max_depth=%max_depth%" %print_debug% :set_path_recursive "Env Var - max_depth=%max_depth%"
if %max_depth% gtr %depth% ( if %max_depth% gtr %depth% (
if "%add_to_path%" neq "" ( if "%add_to_path%" neq "" (
%print_debug% :set_path_recursive "Adding parent directory - '%add_to_path%'" %print_debug% :set_path_recursive "Adding parent directory - '%add_to_path%'"
if "%position%" == "append" ( if "%position%" == "append" (
set "path=%path%;%add_to_path%" set "path=%path%;%add_to_path%"
) else ( ) else (
set "path=%add_to_path%;%path%" set "path=%add_to_path%;%path%"
) )
) )
call :set_depth call :set_depth
@@ -250,9 +250,9 @@ exit /b
) )
for /d %%i in ("%add_path%\*") do ( for /d %%i in ("%add_path%\*") do (
%print_debug% :enhance_path_recursive "Env Var BEFORE - depth=%depth%" %print_debug% :set_path_recursive "Env Var BEFORE - depth=%depth%"
%print_debug% :enhance_path_recursive "Found Subdirectory - '%%~fi'" %print_debug% :set_path_recursive "Found Subdirectory - '%%~fi'"
call :enhance_path_recursive "%%~fi" %depth% %max_depth% %position% call :set_path_recursive "%%~fi" %depth% %max_depth% %position%
%print_debug% :enhance_path_recursive "Env Var AFTER- depth=%depth%" %print_debug% :set_path_recursive "Env Var AFTER- depth=%depth%"
) )
exit /b exit /b

View File

@@ -179,27 +179,27 @@ function getGitStatusSetting() {
} }
function yOrn( $question ) { function yOrn( $question ) {
Do { Do {
$Answer = Read-Host -Prompt "`n${question}? (y/n) " $Answer = Read-Host -Prompt "`n${question}? (y/n) "
} }
Until ($Answer -eq 'y' -or $Answer -eq 'n' -or $Answer -eq 'yes' -or $Answer -eq 'no') 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) { 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' $overwrite = 'y'
if ((test-path "$outfile")) { if ((test-path "$outfile")) {
$overwrite = yOrn "'$outfile' already exists do you want to overwrite it" $overwrite = yOrn "'$outfile' already exists do you want to overwrite it"
} }
if ($overwrite -match 'y') { if ($overwrite -match 'y') {
$expanded | out-file -ErrorAction silentlycontinue -encoding ascii "$outfile" $expanded | out-file -ErrorAction silentlycontinue -encoding ascii "$outfile"
} else { } else {
write-host "Skipping Cmder '$shell' config generation at user request!" write-host "Skipping Cmder '$shell' config generation at user request!"
} }
} }