mirror of
				https://github.com/cmderdev/cmder.git
				synced 2025-11-01 01:42:17 +08:00 
			
		
		
		
	add prompt for vanilla cmd.exe when clink not present
This commit is contained in:
		
							
								
								
									
										4
									
								
								vendor/lib/lib_base.cmd
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/lib/lib_base.cmd
									
									
									
									
										vendored
									
									
								
							| @@ -68,13 +68,9 @@ exit /b | ||||
|     set CMDER_SHELL=%~n1 | ||||
|     if not defined CMDER_CLINK ( | ||||
|         set CMDER_CLINK=1 | ||||
|         if "%CMDER_SHELL%" equ "tcc" set CMDER_CLINK=0 | ||||
|         if "%CMDER_SHELL%" equ "tccle" set CMDER_CLINK=0 | ||||
|     ) | ||||
|     if not defined CMDER_ALIASES ( | ||||
|         set CMDER_ALIASES=1 | ||||
|         if "%CMDER_SHELL%" equ "tcc" set CMDER_ALIASES=0 | ||||
|         if "%CMDER_SHELL%" equ "tccle" set CMDER_ALIASES=0 | ||||
|     ) | ||||
|     exit /b | ||||
|  | ||||
|   | ||||
							
								
								
									
										24
									
								
								vendor/lib/lib_console.cmd
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								vendor/lib/lib_console.cmd
									
									
									
									
										vendored
									
									
								
							| @@ -7,9 +7,10 @@ set ESC= | ||||
| :: Much faster than using "%lib_console% debug_output ..." etc. | ||||
| set print_debug=if %debug_output% gtr 0 %lib_console% debug_output | ||||
| set print_verbose=if %verbose_output% gtr 0 %lib_console% verbose_output | ||||
| set print_warning=if %verbose_output% gtr 0 %lib_console% show_warning | ||||
| set print_error=%lib_console% show_error | ||||
|  | ||||
| if "%fast_init%" == "1" exit /b | ||||
| if %fast_init% gtr %verbose_output% if %fast_init% gtr %debug_output% exit /b | ||||
|  | ||||
| if "%~1" == "/h" ( | ||||
|     %lib_base% help "%~0" | ||||
| @@ -83,3 +84,24 @@ exit /b | ||||
|  | ||||
|     echo %ESC%[91;1mERROR:%ESC%[0m %~1 | ||||
|     exit /b | ||||
|  | ||||
| :show_warning | ||||
| :::=============================================================================== | ||||
| :::show_warning - Output a warning message to the console. | ||||
| :::. | ||||
| :::include: | ||||
| :::. | ||||
| :::  call "$0" | ||||
| :::. | ||||
| :::usage: | ||||
| :::. | ||||
| :::  %lib_console% show_warning "[message]" | ||||
| :::. | ||||
| :::required: | ||||
| :::. | ||||
| :::  [message] <in> Message text to display. | ||||
| :::. | ||||
| :::------------------------------------------------------------------------------- | ||||
|  | ||||
|     echo %ESC%[93;1mWARNING:%ESC%[0m %~1 | ||||
|     exit /b | ||||
|   | ||||
							
								
								
									
										8
									
								
								vendor/lib/lib_git.cmd
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								vendor/lib/lib_git.cmd
									
									
									
									
										vendored
									
									
								
							| @@ -101,9 +101,9 @@ exit /b | ||||
|  | ||||
|     REM endlocal & set "%~1_MAJOR=!%~1_MAJOR!" & set "%~1_MINOR=!%~1_MINOR!" & set "%~1_PATCH=!%~1_PATCH!" & set "%~1_BUILD=!%~1_BUILD!" | ||||
|     if "%~1" == "VENDORED" ( | ||||
|       endlocal & set "%~1_MAJOR=%VENDORED_MAJOR%" & set "%~1_MINOR=%VENDORED_MINOR%" & set "%~1_PATCH=%VENDORED_PATCH%" & set "%~1_BUILD=%VENDORED_BUILD%" | ||||
|         endlocal & set "%~1_MAJOR=%VENDORED_MAJOR%" & set "%~1_MINOR=%VENDORED_MINOR%" & set "%~1_PATCH=%VENDORED_PATCH%" & set "%~1_BUILD=%VENDORED_BUILD%" | ||||
|     ) else ( | ||||
|       endlocal & set "%~1_MAJOR=%USER_MAJOR%" & set "%~1_MINOR=%USER_MINOR%" & set "%~1_PATCH=%USER_PATCH%" & set "%~1_BUILD=%USER_BUILD%" | ||||
|         endlocal & set "%~1_MAJOR=%USER_MAJOR%" & set "%~1_MINOR=%USER_MINOR%" & set "%~1_PATCH=%USER_PATCH%" & set "%~1_BUILD=%USER_BUILD%" | ||||
|     ) | ||||
|  | ||||
|     exit /b | ||||
| @@ -136,9 +136,9 @@ exit /b | ||||
|     :: ... and maybe display it, for debugging purposes. | ||||
|     REM %print_debug% :validate_version "Found Git Version for %~1: !%~1_MAJOR!.!%~1_MINOR!.!%~1_PATCH!.!%~1_BUILD!" | ||||
|     if "%~1" == "VENDORED" ( | ||||
|       %print_debug% :validate_version "Found Git Version for %~1: %VENDORED_MAJOR%.%VENDORED_MINOR%.%VENDORED_PATCH%.%VENDORED_BUILD%" | ||||
|         %print_debug% :validate_version "Found Git Version for %~1: %VENDORED_MAJOR%.%VENDORED_MINOR%.%VENDORED_PATCH%.%VENDORED_BUILD%" | ||||
|     ) else ( | ||||
|       %print_debug% :validate_version "Found Git Version for %~1: %USER_MAJOR%.%USER_MINOR%.%USER_PATCH%.%USER_BUILD%" | ||||
|         %print_debug% :validate_version "Found Git Version for %~1: %USER_MAJOR%.%USER_MINOR%.%USER_PATCH%.%USER_BUILD%" | ||||
|     ) | ||||
|     exit /b | ||||
|  | ||||
|   | ||||
							
								
								
									
										60
									
								
								vendor/lib/lib_path.cmd
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										60
									
								
								vendor/lib/lib_path.cmd
									
									
									
									
										vendored
									
									
								
							| @@ -60,14 +60,14 @@ exit /b | ||||
|     ) | ||||
|  | ||||
|     if "%fast_init%" == "1" ( | ||||
|       if "%position%" == "append" ( | ||||
|         set "PATH=%PATH%;%add_to_path%" | ||||
|       ) else ( | ||||
|         set "PATH=%add_to_path%;%PATH%" | ||||
|       ) | ||||
|       goto :end_enhance_path | ||||
|         if "%position%" == "append" ( | ||||
|             set "PATH=%PATH%;%add_to_path%" | ||||
|         ) else ( | ||||
|             set "PATH=%add_to_path%;%PATH%" | ||||
|         ) | ||||
|         goto :end_enhance_path | ||||
|     ) else if "add_to_path" equ "" ( | ||||
|       goto :end_enhance_path | ||||
|         goto :end_enhance_path | ||||
|     ) | ||||
|  | ||||
|     set found=0 | ||||
| @@ -78,23 +78,23 @@ exit /b | ||||
|  | ||||
|     setlocal enabledelayedexpansion | ||||
|     if "!found!" == "0" ( | ||||
|       echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!;" | ||||
|       call :set_found | ||||
|         echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!;" | ||||
|         call :set_found | ||||
|     ) | ||||
|     %print_debug%  :enhance_path "Env Var INSIDE PATH !find_query! - found=!found!" | ||||
|  | ||||
|     if /i "!position!" == "append" ( | ||||
|       if "!found!" == "0" ( | ||||
|         echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!\"$" | ||||
|         call :set_found | ||||
|       ) | ||||
|       %print_debug%  :enhance_path "Env Var END PATH !find_query! - found=!found!" | ||||
|         if "!found!" == "0" ( | ||||
|             echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!\"$" | ||||
|             call :set_found | ||||
|         ) | ||||
|         %print_debug%  :enhance_path "Env Var END PATH !find_query! - found=!found!" | ||||
|     ) else ( | ||||
|       if "!found!" == "0" ( | ||||
|         echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:"^\"!find_query!;" | ||||
|         call :set_found | ||||
|       ) | ||||
|       %print_debug%  :enhance_path "Env Var BEGIN PATH !find_query! - found=!found!" | ||||
|         if "!found!" == "0" ( | ||||
|             echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:"^\"!find_query!;" | ||||
|             call :set_found | ||||
|         ) | ||||
|         %print_debug%  :enhance_path "Env Var BEGIN PATH !find_query! - found=!found!" | ||||
|     ) | ||||
|     endlocal & set found=%found% | ||||
|  | ||||
| @@ -121,24 +121,24 @@ exit /b | ||||
|     exit /b | ||||
|  | ||||
|     :toolong | ||||
|       echo "%OLD_PATH%">"%temp%\cmder_lib_pathA" | ||||
|       echo "%PATH%">"%temp%\cmder_lib_pathB" | ||||
|       fc /b "%temp%\cmder_lib_pathA" "%temp%\cmder_lib_pathB" 2>nul 1>nul | ||||
|       if errorlevel 1 ( del "%temp%\cmder_lib_pathA" & del "%temp%\cmder_lib_pathB" & goto :changed ) | ||||
|       del "%temp%\cmder_lib_pathA" & del "%temp%\cmder_lib_pathB" | ||||
|       exit /b | ||||
|         echo "%OLD_PATH%">"%temp%\cmder_lib_pathA" | ||||
|         echo "%PATH%">"%temp%\cmder_lib_pathB" | ||||
|         fc /b "%temp%\cmder_lib_pathA" "%temp%\cmder_lib_pathB" 2>nul 1>nul | ||||
|         if errorlevel 1 ( del "%temp%\cmder_lib_pathA" & del "%temp%\cmder_lib_pathB" & goto :changed ) | ||||
|         del "%temp%\cmder_lib_pathA" & del "%temp%\cmder_lib_pathB" | ||||
|         exit /b | ||||
|  | ||||
|     :changed | ||||
|       %print_debug%  :enhance_path "END Env Var - PATH=%path%" | ||||
|       %print_debug%  :enhance_path "Env Var %find_query% - found=%found%" | ||||
|       exit /b | ||||
|         %print_debug%  :enhance_path "END Env Var - PATH=%path%" | ||||
|         %print_debug%  :enhance_path "Env Var %find_query% - found=%found%" | ||||
|         exit /b | ||||
|  | ||||
|     exit /b | ||||
|  | ||||
|  | ||||
| :set_found | ||||
|     if "%ERRORLEVEL%" == "0" ( | ||||
|       set found=1 | ||||
|         set found=1 | ||||
|     ) | ||||
|  | ||||
|     exit /b | ||||
| @@ -202,7 +202,7 @@ exit /b | ||||
|  | ||||
|     set "PATH=%PATH:;;=;%" | ||||
|     if "%fast_init%" == "1" ( | ||||
|       exit /b | ||||
|         exit /b | ||||
|     ) | ||||
|  | ||||
|     %print_debug%  :enhance_path_recursive "Env Var - add_path=%add_to_path%" | ||||
|   | ||||
							
								
								
									
										20
									
								
								vendor/lib/lib_profile.cmd
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										20
									
								
								vendor/lib/lib_profile.cmd
									
									
									
									
										vendored
									
									
								
							| @@ -32,15 +32,15 @@ exit /b | ||||
| :::  path       <out> Sets the path env variable if required. | ||||
| :::------------------------------------------------------------------------------- | ||||
|  | ||||
|   if not exist "%~1" ( | ||||
|     mkdir "%~1" | ||||
|   ) | ||||
|     if not exist "%~1" ( | ||||
|         mkdir "%~1" | ||||
|     ) | ||||
|  | ||||
|   pushd "%~1" | ||||
|   for /f "usebackq" %%x in ( `dir /b *.bat *.cmd 2^>nul` ) do ( | ||||
|     %print_verbose% "Calling '%~1\%%x'..." | ||||
|     call "%~1\%%x" | ||||
|   ) | ||||
|   popd | ||||
|   exit /b | ||||
|     pushd "%~1" | ||||
|     for /f "usebackq" %%x in ( `dir /b *.bat *.cmd 2^>nul` ) do ( | ||||
|         %print_verbose% "Calling '%~1\%%x'..." | ||||
|         call "%~1\%%x" | ||||
|     ) | ||||
|     popd | ||||
|     exit /b | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user