-
Notifications
You must be signed in to change notification settings - Fork 11
/
go.bat
48 lines (40 loc) · 1.26 KB
/
go.bat
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
@echo off
rem Invoke developer tools.
rem Invoke without arguments to get a list of available tools.
rem Requires the ohdevtools to be available locally. Set
rem OHDEVTOOLS_ROOT to their directory if this script cannot
rem find them.
setlocal
set PROJECT_ROOT=%~dp0
cd %PROJECT_ROOT%
rem Force Python processes to be unbuffered. Prevents jumbled
rem output during CI builds due to buffering on stdout.
set PYTHONUNBUFFERED=x
call :fallback_devtools "%PROJECT_ROOT%\ohdevtools"
call :fallback_devtools "%PROJECT_ROOT%\..\ohdevtools"
if not exist "%OHDEVTOOLS_ROOT%" (
echo OHDEVTOOLS_ROOT not set.
echo Tried looking in %OHDEVTOOLS_ROOT%.
echo Please set OHDEVTOOLS_ROOT to point to the location of the ohdevtools scripts.
exit /b 1
)
if defined PYTHONPATH (
set PYTHONPATH=%OHDEVTOOLS_ROOT%;%PYTHONPATH%
) else (
set PYTHONPATH=%OHDEVTOOLS_ROOT%
)
:run
python -u -m go %*
if errorlevel 1 exit /b 1
goto :eof
:fallback_devtools
rem If OHDEVTOOLS_ROOT doesn't point to an existing directory,
rem point it towards the provided directory converted to an
rem absolute path.
if defined OHDEVTOOLS_ROOT (
if exist "%OHDEVTOOLS_ROOT%" (
exit /b 0
)
)
set OHDEVTOOLS_ROOT=%~f1
exit /b 0