forked from DotHarness/dotcraft
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
81 lines (68 loc) · 1.51 KB
/
Copy pathsetup.bat
File metadata and controls
81 lines (68 loc) · 1.51 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
@echo off
setlocal
set "SCRIPT_DIR=%~dp0"
set "PS_ARGS="
set "MODE=install"
:parse_args
if "%~1"=="" goto run_setup
if /I "%~1"=="/check" (
set "PS_ARGS=%PS_ARGS% -Check"
set "MODE=check"
shift
goto parse_args
)
if /I "%~1"=="--check" (
set "PS_ARGS=%PS_ARGS% -Check"
set "MODE=check"
shift
goto parse_args
)
if /I "%~1"=="/yes" (
set "PS_ARGS=%PS_ARGS% -Yes"
shift
goto parse_args
)
if /I "%~1"=="--yes" (
set "PS_ARGS=%PS_ARGS% -Yes"
shift
goto parse_args
)
if /I "%~1"=="/?" (
set "PS_ARGS=%PS_ARGS% -Help"
set "MODE=help"
shift
goto parse_args
)
if /I "%~1"=="--help" (
set "PS_ARGS=%PS_ARGS% -Help"
set "MODE=help"
shift
goto parse_args
)
echo Unknown argument: %~1
echo.
echo Usage:
echo setup.bat Check and prompt to install missing tools
echo setup.bat /check Check only
echo setup.bat /yes Install missing tools without confirmation
exit /b 2
:run_setup
powershell -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT_DIR%scripts\setup-dev-env.ps1"%PS_ARGS%
set "EXIT_CODE=%ERRORLEVEL%"
if not "%EXIT_CODE%"=="0" (
echo.
if "%MODE%"=="check" (
echo DotCraft developer environment check found missing tools.
) else (
echo DotCraft developer environment setup failed.
)
exit /b %EXIT_CODE%
)
if "%MODE%"=="help" exit /b 0
echo.
if "%MODE%"=="check" (
echo DotCraft developer environment check completed.
) else (
echo DotCraft developer environment setup completed.
)
exit /b 0