mirror of
https://github.com/cmderdev/cmder.git
synced 2025-06-15 14:17:50 +08:00
Trying to get tcc working
This commit is contained in:
18
vendor/lib/lib_console.cmd
vendored
18
vendor/lib/lib_console.cmd
vendored
@ -13,9 +13,9 @@ if "%~1" == "/h" (
|
||||
|
||||
exit /b
|
||||
|
||||
:debug-output
|
||||
:debug_output
|
||||
:::===============================================================================
|
||||
:::debug-output - Output a debug message to the console.
|
||||
:::debug_output - Output a debug message to the console.
|
||||
:::.
|
||||
:::include:
|
||||
:::.
|
||||
@ -23,22 +23,22 @@ exit /b
|
||||
:::.
|
||||
:::usage:
|
||||
:::.
|
||||
::: %lib_console% debug-output [caller] [message]
|
||||
::: %lib_console% debug_output [caller] [message]
|
||||
:::.
|
||||
:::required:
|
||||
:::.
|
||||
::: [caller] <in> Script/sub routine name calling debug-output
|
||||
::: [caller] <in> Script/sub routine name calling debug_output
|
||||
:::.
|
||||
::: [message] <in> Message text to display.
|
||||
:::.
|
||||
:::-------------------------------------------------------------------------------
|
||||
|
||||
if %debug-output% gtr 0 echo DEBUG(%~1): %~2 & echo.
|
||||
if %debug_output% gtr 0 echo DEBUG(%~1): %~2 & echo.
|
||||
exit /b
|
||||
|
||||
:verbose-output
|
||||
:verbose_output
|
||||
:::===============================================================================
|
||||
:::verbose-output - Output a debug message to the console.
|
||||
:::verbose_output - Output a debug message to the console.
|
||||
:::.
|
||||
:::include:
|
||||
:::.
|
||||
@ -46,7 +46,7 @@ exit /b
|
||||
:::.
|
||||
:::usage:
|
||||
:::.
|
||||
::: %lib_console% verbose-output "[message]"
|
||||
::: %lib_console% verbose_output "[message]"
|
||||
:::.
|
||||
:::required:
|
||||
:::.
|
||||
@ -54,7 +54,7 @@ exit /b
|
||||
:::.
|
||||
:::-------------------------------------------------------------------------------
|
||||
|
||||
if %verbose-output% gtr 0 echo %~1
|
||||
if %verbose_output% gtr 0 echo %~1
|
||||
exit /b
|
||||
|
||||
:show_error
|
||||
|
14
vendor/lib/lib_git.cmd
vendored
14
vendor/lib/lib_git.cmd
vendored
@ -42,11 +42,11 @@ exit /b
|
||||
|
||||
:: set the executable path
|
||||
set "git_executable=%~2\git.exe"
|
||||
%lib_console% debug-output :read_version "Env Var - git_executable=%git_executable%"
|
||||
%lib_console% debug_output :read_version "Env Var - git_executable=%git_executable%"
|
||||
|
||||
:: check if the executable actually exists
|
||||
if not exist "%git_executable%" (
|
||||
%lib_console% debug-output :read_version "%git_executable% does not exist."
|
||||
%lib_console% debug_output :read_version "%git_executable% does not exist."
|
||||
exit /b -255
|
||||
)
|
||||
|
||||
@ -54,7 +54,7 @@ exit /b
|
||||
for /F "tokens=1,2,3 usebackq" %%A in (`"%git_executable%" --version 2^>nul`) do (
|
||||
if /i "%%A %%B" == "git version" (
|
||||
set "GIT_VERSION_%~1=%%C"
|
||||
%lib_console% debug-output :read_version "Env Var - GIT_VERSION_%~1=%%C"
|
||||
%lib_console% debug_output :read_version "Env Var - GIT_VERSION_%~1=%%C"
|
||||
) else (
|
||||
%lib_console% show_error "git --version" returned an inproper version string!
|
||||
pause
|
||||
@ -124,7 +124,7 @@ exit /b
|
||||
call :parse_version %~1 %~2
|
||||
|
||||
:: ... and maybe display it, for debugging purposes.
|
||||
%lib_console% debug-output :validate_version "Found Git Version for %~1: !%~1_MAJOR!.!%~1_MINOR!.!%~1_PATCH!.!%~1_BUILD!"
|
||||
%lib_console% debug_output :validate_version "Found Git Version for %~1: !%~1_MAJOR!.!%~1_MINOR!.!%~1_PATCH!.!%~1_BUILD!"
|
||||
exit /b
|
||||
|
||||
:compare_versions
|
||||
@ -148,9 +148,9 @@ exit /b
|
||||
:: checks all major, minor, patch and build variables for the given arguments.
|
||||
:: whichever binary that has the most recent version will be used based on the return code.
|
||||
|
||||
:: %lib_console% debug-output Comparing:
|
||||
:: %lib_console% debug-output %~1: !%~1_MAJOR!.!%~1_MINOR!.!%~1_PATCH!.!%~1_BUILD!
|
||||
:: %lib_console% debug-output %~2: !%~2_MAJOR!.!%~2_MINOR!.!%~2_PATCH!.!%~2_BUILD!
|
||||
:: %lib_console% debug_output Comparing:
|
||||
:: %lib_console% debug_output %~1: !%~1_MAJOR!.!%~1_MINOR!.!%~1_PATCH!.!%~1_BUILD!
|
||||
:: %lib_console% debug_output %~2: !%~2_MAJOR!.!%~2_MINOR!.!%~2_PATCH!.!%~2_BUILD!
|
||||
|
||||
if !%~1_MAJOR! GTR !%~2_MAJOR! (exit /b 1)
|
||||
if !%~1_MAJOR! LSS !%~2_MAJOR! (exit /b -1)
|
||||
|
28
vendor/lib/lib_path.cmd
vendored
28
vendor/lib/lib_path.cmd
vendored
@ -57,28 +57,28 @@ exit /b
|
||||
set "find_query=%find_query: =\ %"
|
||||
set found=0
|
||||
|
||||
%lib_console% debug-output :enhance_path "Env Var - find_query=%find_query%"
|
||||
%lib_console% debug_output :enhance_path "Env Var - find_query=%find_query%"
|
||||
echo "%PATH%"|findstr >nul /I /R ";%find_query%\"$"
|
||||
if "!ERRORLEVEL!" == "0" set found=1
|
||||
|
||||
%lib_console% debug-output :enhance_path "Env Var 1 - found=!found!"
|
||||
%lib_console% debug_output :enhance_path "Env Var 1 - found=!found!"
|
||||
if "!found!" == "0" (
|
||||
echo "%PATH%"|findstr >nul /i /r ";%find_query%;"
|
||||
if "!ERRORLEVEL!" == "0" set found=1
|
||||
%lib_console% debug-output :enhance_path "Env Var 2 - found=!found!"
|
||||
%lib_console% debug_output :enhance_path "Env Var 2 - found=!found!"
|
||||
)
|
||||
|
||||
if "%found%" == "0" (
|
||||
%lib_console% debug-output :enhance_path "BEFORE Env Var - PATH=!path!"
|
||||
%lib_console% debug_output :enhance_path "BEFORE Env Var - PATH=!path!"
|
||||
if /i "%position%" == "append" (
|
||||
%lib_console% debug-output :enhance_path "Appending '%add_path%'"
|
||||
%lib_console% debug_output :enhance_path "Appending '%add_path%'"
|
||||
set "PATH=%PATH%;%add_path%"
|
||||
) else (
|
||||
%lib_console% debug-output :enhance_path "Prepending '%add_path%'"
|
||||
%lib_console% debug_output :enhance_path "Prepending '%add_path%'"
|
||||
set "PATH=%add_path%;%PATH%"
|
||||
)
|
||||
|
||||
%lib_console% debug-output :enhance_path "AFTER Env Var - PATH=!path!"
|
||||
%lib_console% debug_output :enhance_path "AFTER Env Var - PATH=!path!"
|
||||
)
|
||||
|
||||
endlocal & set "PATH=%PATH:;;=;%"
|
||||
@ -134,20 +134,20 @@ exit /b
|
||||
|
||||
if "%depth%" == "" set depth=0
|
||||
|
||||
%lib_console% debug-output :enhance_path_recursive "Env Var - add_path=%add_path%"
|
||||
%lib_console% debug-output :enhance_path_recursive "Env Var - position=%position%"
|
||||
%lib_console% debug-output :enhance_path_recursive "Env Var - max_depth=%max_depth%"
|
||||
%lib_console% debug_output :enhance_path_recursive "Env Var - add_path=%add_path%"
|
||||
%lib_console% debug_output :enhance_path_recursive "Env Var - position=%position%"
|
||||
%lib_console% debug_output :enhance_path_recursive "Env Var - max_depth=%max_depth%"
|
||||
|
||||
if %max_depth% gtr !depth! (
|
||||
%lib_console% debug-output :enhance_path_recursive "Adding parent directory - '%add_path%'"
|
||||
%lib_console% debug_output :enhance_path_recursive "Adding parent directory - '%add_path%'"
|
||||
call :enhance_path "%add_path%" %position%
|
||||
set /a "depth=!depth!+1"
|
||||
|
||||
for /d %%i in ("%add_path%\*") do (
|
||||
%lib_console% debug-output :enhance_path_recursive "Env Var BEFORE - depth=!depth!"
|
||||
%lib_console% debug-output :enhance_path_recursive "Found Subdirectory - '%%~fi'"
|
||||
%lib_console% debug_output :enhance_path_recursive "Env Var BEFORE - depth=!depth!"
|
||||
%lib_console% debug_output :enhance_path_recursive "Found Subdirectory - '%%~fi'"
|
||||
call :enhance_path_recursive "%%~fi" %max_depth% %position%
|
||||
%lib_console% debug-output :enhance_path_recursive "Env Var AFTER- depth=!depth!"
|
||||
%lib_console% debug_output :enhance_path_recursive "Env Var AFTER- depth=!depth!"
|
||||
)
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user