Skip to content

Commit

Permalink
fix checking for clink injection
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSDavidSoft committed Dec 20, 2022
1 parent 3b6e1cb commit 9e55c48
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions vendor/init.bat
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,19 @@ if "%PROCESSOR_ARCHITECTURE%"=="x86" (
)

if "%CMDER_CLINK%" == "1" (
REM TODO: If clink is already injected, goto :CLINK_FINISH
goto :INJECT_CLINK
)

goto :SKIP_CLINK

:INJECT_CLINK
%print_verbose% "Injecting Clink!"

:: Check if Clink is not present
if not exist "%CMDER_ROOT%\vendor\clink\clink_%clink_architecture%.exe" (
%print_error% "Clink executable is not present in 'vendor\clink\clink_%clink_architecture%.exe'"
goto :SKIP_CLINK
)

:: Run Clink
Expand Down Expand Up @@ -200,7 +208,10 @@ if "%CMDER_CLINK%" == "1" (
if errorlevel 1 (
%print_error% "Clink initilization has failed with error code: %errorlevel%"
)
) else (

goto :CLINK_FINISH

:SKIP_CLINK
%print_warning% "Skipping Clink Injection!"

for /f "tokens=2 delims=:." %%x in ('chcp') do set cp=%%x
Expand All @@ -210,7 +221,8 @@ if "%CMDER_CLINK%" == "1" (
prompt $E[1;32;49m$P$S$_$E[1;30;49mλ$S$E[0m

chcp %cp%>nul
)

:CLINK_FINISH

if "%CMDER_CONFIGURED%" GTR "1" (
%print_verbose% "Cmder is already configured, skipping Cmder Init!"
Expand Down

0 comments on commit 9e55c48

Please sign in to comment.