-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdsh.cmd
More file actions
27 lines (25 loc) · 1.01 KB
/
Copy pathdsh.cmd
File metadata and controls
27 lines (25 loc) · 1.01 KB
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
@echo off
setlocal
set "DSH_LAUNCHER_DIR=%~dp0"
if exist "%DSH_LAUNCHER_DIR%dsh-launcher.exe" (
if "%~1"=="" goto background
if /I "%~1"=="start" if "%~2"=="" goto background
if /I "%~1"=="stop" if "%~2"=="" goto background
if /I "%~1"=="restart" if "%~2"=="" goto background
if /I "%~1"=="status" if "%~2"=="" goto background
if /I "%~1"=="open" if "%~2"=="" goto background
if /I "%~1"=="logs" if "%~2"=="" goto background
if /I "%~1"=="doctor" goto foreground
if /I "%~1"=="--foreground" goto foreground
)
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -ExecutionPolicy Bypass -File "%DSH_LAUNCHER_DIR%dsh-launcher.ps1" -CommandName dsh %*
set "DSH_EXIT_CODE=%ERRORLEVEL%"
endlocal & exit /b %DSH_EXIT_CODE%
:background
start "" /b "%DSH_LAUNCHER_DIR%dsh-launcher.exe" %*
set "DSH_EXIT_CODE=%ERRORLEVEL%"
endlocal & exit /b %DSH_EXIT_CODE%
:foreground
"%DSH_LAUNCHER_DIR%dsh-launcher.exe" %*
set "DSH_EXIT_CODE=%ERRORLEVEL%"
endlocal & exit /b %DSH_EXIT_CODE%