-
Notifications
You must be signed in to change notification settings - Fork 2k
/
vscode_init.cmd
36 lines (31 loc) · 1.01 KB
/
vscode_init.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@echo off
:: Find root dir
if not defined CMDER_ROOT (
for /f "delims=" %%i in ("%~dp0\..\..") do (
set "cmder_root=%%~fi"
)
)
if defined cmder_user_bin (
if exist "%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" (
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 (
call "%CMDER_VSCODE_INIT_ARGS%"
)
IF [%1] == [] (
REM -- manually opened console (Ctrl + Shift + `) --
CALL "%~dp0..\init.bat"
) ELSE (
REM -- task --
CALL cmd %*
exit
)