-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathactivate-env.bat
More file actions
42 lines (35 loc) · 1.13 KB
/
Copy pathactivate-env.bat
File metadata and controls
42 lines (35 loc) · 1.13 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
@echo off
if "%1"=="deactivate" goto :deactivate-env
if "%1"=="d" goto :deactivate-env
if defined TDO_DEVKIT_PATH (
goto :add_path
)
if exist ".devkit-path" (
for /f "delims=" %%a in (.devkit-path) do set "TDO_DEVKIT_PATH=%%a"
goto :add_path
)
set "TDO_DEVKIT_PATH=%~dp0"
set "TDO_DEVKIT_PATH=%TDO_DEVKIT_PATH:~0,-1%"
:add_path
set "PATH=%PATH%;%TDO_DEVKIT_PATH%\bin\compiler\win"
set "PATH=%PATH%;%TDO_DEVKIT_PATH%\bin\tools\win"
set "PATH=%PATH%;%TDO_DEVKIT_PATH%\bin\buildtools\win"
where armcc >nul 2>&1
if %errorlevel% equ 0 (
echo 3DO development environment activated. Run 'activate-env.bat deactivate' to deactivate.
goto :eof
) else (
echo Error: Activation failed. armcc not found in PATH.
if exist ".devkit-path" (
echo Note: .devkit-path contains: "%TDO_DEVKIT_PATH%"
echo If this path is wrong, update .devkit-path.
)
goto :eof
)
:deactivate-env
set "PATH=%PATH:;%TDO_DEVKIT_PATH%\bin\compiler\win=%"
set "PATH=%PATH:;%TDO_DEVKIT_PATH%\bin\tools\win=%"
set "PATH=%PATH:;%TDO_DEVKIT_PATH%\bin\buildtools\win=%"
set "TDO_DEVKIT_PATH="
echo 3DO development environment deactivated.
goto :eof