forked from Azure/device-simulation-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclean-up.cmd
48 lines (37 loc) · 1007 Bytes
/
clean-up.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
37
38
39
40
41
42
43
44
45
46
47
48
:: Copyright (c) Microsoft. All rights reserved.
@ECHO off & setlocal enableextensions enabledelayedexpansion
:: strlen("\scripts\") => 9
SET APP_HOME=%~dp0
SET APP_HOME=%APP_HOME:~0,-9%
if "%APP_HOME:~20%" == "" (
echo Unable to detect current folder. Aborting.
GOTO FAIL
)
:: Clean up folders containing temporary files
echo Removing temporary folders and files...
cd %APP_HOME%
IF %ERRORLEVEL% NEQ 0 GOTO FAIL
rmdir /s /q .\packages
rmdir /s /q .\target
rmdir /s /q .\out
rmdir /s /q .\Services\bin
rmdir /s /q .\Services\obj
rmdir /s /q .\Services.Test\bin
rmdir /s /q .\Services.Test\obj
rmdir /s /q .\WebService\bin
rmdir /s /q .\WebService\obj
rmdir /s /q .\WebService.Test\bin
rmdir /s /q .\WebService.Test\obj
rmdir /s /q .\SimulationAgent\bin
rmdir /s /q .\SimulationAgent\obj
rmdir /s /q .\SimulationAgent.Test\bin
rmdir /s /q .\SimulationAgent.Test\obj
echo Done.
:: - - - - - - - - - - - - - -
goto :END
:FAIL
echo Command failed
endlocal
exit /B 1
:END
endlocal