-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d895cd7
commit e2a0d8d
Showing
12 changed files
with
197 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,64 @@ | ||
:: Copyright (c) 2012 Martin Ridgers | ||
:: License: http://opensource.org/licenses/MIT | ||
|
||
@echo off | ||
rem -- Copyright (c) 2012 Martin Ridgers | ||
rem -- Portions Copyright (c) 2020-2024 Christopher Antos | ||
rem -- License: http://opensource.org/licenses/MIT | ||
|
||
setlocal enableextensions | ||
set clink_profile_arg= | ||
set clink_quiet_arg= | ||
|
||
:: Mimic cmd.exe's behaviour when starting from the start menu. | ||
rem -- Mimic cmd.exe's behaviour when starting from the start menu. | ||
if /i "%~1"=="startmenu" ( | ||
cd /d "%userprofile%" | ||
shift | ||
) | ||
|
||
:: Check for the --profile option. | ||
rem -- Check for the --profile option. | ||
if /i "%~1"=="--profile" ( | ||
set clink_profile_arg=--profile "%~2" | ||
shift | ||
shift | ||
) | ||
|
||
:: Check for the --quiet option. | ||
rem -- Check for the --quiet option. | ||
if /i "%~1"=="--quiet" ( | ||
set clink_quiet_arg= --quiet | ||
shift | ||
) | ||
|
||
:: If the .bat is run without any arguments, then start a cmd.exe instance. | ||
rem -- If the .bat is run without any arguments, then start a cmd.exe instance. | ||
if _%1==_ ( | ||
call :launch | ||
goto :end | ||
) | ||
|
||
:: Test for autorun. | ||
rem -- Test for autorun. | ||
if defined CLINK_NOAUTORUN if /i "%~1"=="inject" if /i "%~2"=="--autorun" goto :end | ||
|
||
:: Endlocal before inject tags the prompt. | ||
endlocal | ||
|
||
:: Pass through to appropriate loader. | ||
rem -- Forward to appropriate loader, and endlocal before inject tags the prompt. | ||
if /i "%processor_architecture%"=="x86" ( | ||
endlocal | ||
"%~dp0\clink_x86.exe" %* | ||
) else if /i "%processor_architecture%"=="arm64" ( | ||
endlocal | ||
"%~dp0\clink_arm64.exe" %* | ||
) else if /i "%processor_architecture%"=="amd64" ( | ||
if defined processor_architew6432 ( | ||
endlocal | ||
"%~dp0\clink_x86.exe" %* | ||
) else ( | ||
endlocal | ||
"%~dp0\clink_x64.exe" %* | ||
) | ||
) | ||
|
||
:end | ||
goto :eof | ||
goto :end | ||
|
||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
:launch | ||
setlocal | ||
setlocal enableextensions | ||
set WT_PROFILE_ID= | ||
set WT_SESSION= | ||
start "Clink" cmd.exe /s /k ""%~dpnx0" inject %clink_profile_arg%%clink_quiet_arg%" | ||
endlocal | ||
exit /b 0 | ||
|
||
:end |
Oops, something went wrong.