Skip to content

Commit e9750ab

Browse files
authored
avoid erroneous messages, skip clink if injection fails fatally
1 parent 59e14a1 commit e9750ab

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

vendor/init.bat

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ if not "%CMDER_SHELL%" == "cmd" (
153153
set CMDER_ALIASES=0
154154
)
155155

156-
:: Pick right version of Clink
156+
:: Pick the right version of Clink
157+
:: TODO: Support for ARM
157158
if "%PROCESSOR_ARCHITECTURE%"=="x86" (
158159
set clink_architecture=x86
159160
set architecture_bits=32
@@ -166,7 +167,7 @@ if "%PROCESSOR_ARCHITECTURE%"=="x86" (
166167
)
167168

168169
if "%CMDER_CLINK%" == "1" (
169-
REM TODO: If clink is already injected, goto :CLINK_FINISH
170+
REM TODO: Detect if clink is already injected, if so goto :CLINK_FINISH
170171
goto :INJECT_CLINK
171172
)
172173

@@ -205,8 +206,10 @@ goto :SKIP_CLINK
205206

206207
"%CMDER_ROOT%\vendor\clink\clink_%clink_architecture%.exe" inject --quiet --profile "%CMDER_CONFIG_DIR%" --scripts "%CMDER_ROOT%\vendor"
207208

208-
if errorlevel 1 (
209-
%print_error% "Clink initialization has failed with error code: %errorlevel%"
209+
:: Check if a fatal error occurred when trying to inject Clink
210+
if errorlevel 2 (
211+
REM %print_error% "Clink injection has failed with error code: %errorlevel%"
212+
goto :SKIP_CLINK
210213
)
211214

212215
goto :CLINK_FINISH
@@ -237,8 +240,8 @@ if "%CMDER_CONFIGURED%" GTR "1" (
237240
:: Prepare for git-for-windows
238241

239242
:: Detect which git.exe version to use
240-
:: * if the users points as to a specific git, use that
241-
:: * test if a git is in path and if yes, use that
243+
:: * if the user points to a specific git, use that
244+
:: * test if git is in path and if yes, use that
242245
:: * last, use our vendored git
243246
:: also check that we have a recent enough version of git by examining the version string
244247
if defined GIT_INSTALL_ROOT (

0 commit comments

Comments
 (0)