make vscode_init.cmd smart enough to apply cmder settings if launched from inside or outside cmder

This commit is contained in:
Dax T. Games 2020-07-04 14:23:16 -04:00
parent f1c1354c00
commit 5e7a7029d1

View File

@ -11,18 +11,15 @@ if not defined CMDER_ROOT (
if defined cmder_user_bin ( if defined cmder_user_bin (
if exist "%cmder_user_bin%\vscode_init_args.cmd" ( if exist "%cmder_user_bin%\vscode_init_args.cmd" (
set CMDER_VSCODE_INIT_ARGS=%cmder_user_bin%\vscode_init_args.cmd set CMDER_VSCODE_INIT_ARGS=%cmder_user_bin%\vscode_init_args.cmd
) else (
echo Creating initial "%CMDER_ROOT%\bin\vscode_init_args.cmd"...
copy "%CMDER_ROOT%\bin\vscode_init_args.cmd.default" "%cmder_user_bin%\vscode_init_args.cmd"
) )
) else if exist "%CMDER_ROOT%\bin\vscode_init_args.cmd" ( ) else if exist "%CMDER_ROOT%\bin\vscode_init_args.cmd" (
set CMDER_VSCODE_INIT_ARGS=%CMDER_ROOT%\bin\vscode_init_args.cmd set CMDER_VSCODE_INIT_ARGS=%CMDER_ROOT%\bin\vscode_init_args.cmd
) else (
echo Creating initial "%CMDER_ROOT%\bin\vscode_init_args.cmd"...
copy "%CMDER_ROOT%\bin\vscode_init_args.cmd.default" "%CMDER_ROOT%\bin\vscode_init_args.cmd"
) )
if defined CMDER_VSCODE_INIT_ARGS ( if not exist "%CMDER_VSCODE_INIT_ARGS%" (
echo Creating initial "%CMDER_VSCODE_INIT_ARGS%"...
copy "%CMDER_ROOT%\vendor\bin\vscode_init_args.cmd.default" "%CMDER_VSCODE_INIT_ARGS%"
else (
call "%CMDER_VSCODE_INIT_ARGS%" call "%CMDER_VSCODE_INIT_ARGS%"
) )