2013-12-25 03:45:43 +08:00
@ echo off
2023-09-25 23:14:54 +08:00
2013-12-25 03:45:43 +08:00
SET CMDER_ROOT = %~dp0
Added/enhanced bash with cmder.sh/user-cmder.sh, organized tasks menu
added personal files to .gitignore so they never get uploaded to the repo and added support for msys2 bash in the new git for windows
added autocreate of config/user-cmder.sh if iot does not exist and added it to the .gitignore
Added tasks: cmd::Cmder, cmd::Cmder as Admin, bash::bash, bash::bash as Admin, bash::mintty, bash::mintty as admin, powershell::powershell, powershell::powershell as Admin. Set default task to cmd::Cmder. Cot rid of init.bat running before /bin/bash, fixes double exit requirement
Added running git for windows post-install.bat on first cmder launch
fixed file/path not found errors when launching powershell as admin
fixed file/path not found errors when launching bash/mintty as admin
fixed PATH in vendor/cmder.sh
Added sourcing ~/.bashrc if it exists.
changed .gitignore to ignore anything with path of config/user-*
removed my personal files from .gitignore, left in config/user-*
Make sure $CMDER_ROOT does not have a trailing '/'
%CMDER_ROOT% does not have trailing '\'. allow user to specify a conemu.xml on the command line
Removed '\' from %CMDER_ROOT%
2015-11-09 11:25:42 +08:00
2023-11-23 20:20:26 +08:00
set CMDER_TERMINAL = conemu
2023-09-25 23:14:54 +08:00
if exist " %CMDER_ROOT% \vendor\windows-terminal\windowsterminal.exe " (
SET CMDER_TERMINAL = windows-terminal
2022-09-01 21:00:43 +08:00
)
2023-09-25 23:14:54 +08:00
if NOT " %~1 " == " " (
SET CMDER_TERMINAL = %~1
shift
2015-11-15 02:15:42 +08:00
)
2023-09-25 23:14:54 +08:00
: : Remove Trailing '\'
if " %CMDER_ROOT:~-1% " == " \ " SET CMDER_ROOT = %CMDER_ROOT:~0,-1%
if not exist " %CMDER_ROOT% \config " md " %CMDER_ROOT% \config " 2 > nul
call : %CMDER_TERMINAL%
exit /b
: conemu
if not exist " %CMDER_ROOT% \config\user_ConEmu.xml " (
copy " %CMDER_ROOT% \vendor\ConEmu.xml.default " " %CMDER_ROOT% \config\user_ConEmu.xml " 1 > nul
if %errorlevel% neq 0 (
echo ERROR: CMDER Initialization has Failed
exit /b 1
)
)
2023-11-11 09:57:46 +08:00
2023-09-25 23:14:54 +08:00
if exist " %~1 " (
start %cmder_root% \vendor\conemu-maximus5\ConEmu.exe /Icon " %CMDER_ROOT% \icons\cmder.ico " /Title Cmder /LoadCfgFile " %~1 "
) else (
start %cmder_root% \vendor\conemu-maximus5\ConEmu.exe /Icon " %CMDER_ROOT% \icons\cmder.ico " /Title Cmder /LoadCfgFile " %CMDER_ROOT% \config\user_ConEmu.xml "
)
exit /b
: windows-terminal
if not exist " %CMDER_ROOT% \vendor\windows-terminal\settings " md " %CMDER_ROOT% \vendor\windows-terminal\settings " 2 > nul
2023-09-26 23:24:34 +08:00
if not exist " %CMDER_ROOT% \vendor\windows-terminal\.portable " echo " This makes this installation of Windows Terminal portable " > " %CMDER_ROOT% \vendor\windows-terminal\.portable " 2 > nul
2023-09-25 23:14:54 +08:00
if exist " %CMDER_ROOT% \config\user_windows_terminal_settings.json " (
if not exist " %CMDER_ROOT% \vendor\windows-terminal\settings\settings.json " (
echo " Copying user Windows Terminal settings to ' %CMDER_ROOT% \vendor\windows-terminal\settings\settings.json'... "
copy " %CMDER_ROOT% \config\user_windows_terminal_settings.json " " %CMDER_ROOT% \vendor\windows-terminal\settings\settings.json " 1 > nul
)
) else if not exist "%CMDER_ROOT%\config\user_windows_terminal_settings.json" (
if not exist " %CMDER_ROOT% \config " mkdir " %CMDER_ROOT% \config " 2 > nul
echo " Copying default Windows Terminal settings to ' %CMDER_ROOT% \config'... "
copy " %CMDER_ROOT% \vendor\windows_terminal_default_settings.json " " %CMDER_ROOT% \config\user_windows_terminal_settings.json " 1 > nul
echo " Copying default Windows Terminal settings to ' %CMDER_ROOT% \vendor\windows-terminal\settings\settings.json'... "
copy " %CMDER_ROOT% \vendor\windows_terminal_default_settings.json " " %CMDER_ROOT% \vendor\windows-terminal\settings\settings.json " 1 > nul
if %errorlevel% neq 0 (
echo ERROR: CMDER Initialization has Failed
exit /b 1
)
) else if exist "%cmder_root%\vendor\windows-terminal\settings\settings.json" (
copy " %cmder_root% \vendor\windows-terminal\settings\settings.json " " %CMDER_ROOT% \config\user_windows_terminal_settings.json "
)
start %cmder_root% \vendor\windows-terminal\windowsterminal.exe
exit /b