-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstop.cmd
More file actions
29 lines (22 loc) · 895 Bytes
/
Copy pathstop.cmd
File metadata and controls
29 lines (22 loc) · 895 Bytes
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
@echo off
setlocal
for %%I in ("%~dp0.") do set "PROJECT_ROOT=%%~fI"
set "STOP_SCRIPT=%PROJECT_ROOT%\scripts\stop-project.ps1"
if not exist "%STOP_SCRIPT%" (
echo [ERROR] Stop script was not found: "%STOP_SCRIPT%"
exit /b 1
)
rem Leave the project directory before stopping anything. A cmd process whose
rem current directory is inside the project can prevent the folder from moving
rem or being deleted.
cd /d "%TEMP%"
set "STOP_ARGUMENTS="
if /I "%~1"=="--dry-run" set "STOP_ARGUMENTS=-WhatIf"
if /I "%~1"=="--include-editors" set "STOP_ARGUMENTS=-IncludeEditors"
powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File "%STOP_SCRIPT%" -ProjectRoot "%PROJECT_ROOT%" %STOP_ARGUMENTS%
set "STOP_EXIT_CODE=%ERRORLEVEL%"
if not "%STOP_EXIT_CODE%"=="0" (
echo.
echo The project was not fully released. Review the messages above.
)
endlocal & exit /b %STOP_EXIT_CODE%