Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathconfigure.bat
More file actions
Latest commit
114 lines (90 loc) · 2.99 KB
/
Copy pathconfigure.bat
File metadata and controls
114 lines (90 loc) · 2.99 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
@echoOFF
setlocal
@rem Copyright (c) nexB Inc. http://www.nexb.com/ - All rights reserved.
@rem ################################
@rem # A configuration script for Windows
@rem # The possible options and arguments are:
@rem # --clean : this is exclusive of anything else and cleans the environment
@rem # from built and installed files
@rem # <some conf path> : this must be the last argument and sets the path to a
@rem # configuration directory to use.
@rem # --python < path to python.exe> : this must be the first argument and set
@rem # the path to the Python executable to use. If < path to python.exe> is
@rem # set to "path", then the executable will be the python.exe available
@rem # in the PATH.
@rem ################################
@rem ################################
@rem # Defaults. Change these variables to customize this script locally
@rem ################################
@rem # you can define one or more thirdparty dirs, each prefixed with TPP_DIR
setTPP_DIR=thirdparty
@rem # A fallback Python location.
@rem # To use a given interpreter, you should use the --python option with a
@rem # value pointing to your Python executable
setDEFAULT_PYTHON=C:\Python27\python.exe
@rem # default configurations for dev
set"CONF_DEFAULT=etc/conf/dev"
@rem #################################
setCFG_ROOT_DIR=%~dp0
setCONFIGURED_PYTHON=%CFG_ROOT_DIR%Scripts\python.exe
set"CFG_CMD_LINE_ARGS="
python --version
python -c "import sys;print(sys.executable)"
@rem parse command line options and arguments
if""%1""=="""" (
setCFG_CMD_LINE_ARGS=%CONF_DEFAULT%
goto python
)
if""%1""==""--clean"" (
setCFG_CMD_LINE_ARGS=--clean
goto python
)
if""%1""==""--python"" (
setPROVIDED_PYTHON=%2
if""%3""=="""" (
setCFG_CMD_LINE_ARGS=%CONF_DEFAULT%
) else (
setCFG_CMD_LINE_ARGS=%3
)
goto python
) else (
setCFG_CMD_LINE_ARGS=%1
goto python
)
@rem Pick a Python interpreter
:python
ifexist"%CONFIGURED_PYTHON%" (
ifnot""%1""==""--clean"" (
@rem we do not want to use the configured Python in clean... it will be deleted
setPYTHON_EXECUTABLE=%CONFIGURED_PYTHON%
goto run
)
)
if""%PROVIDED_PYTHON%""==""path"" (
@rem use a bare python available in the PATH
setPYTHON_EXECUTABLE=python
goto run
)
ifexist"%PROVIDED_PYTHON%" (
setPYTHON_EXECUTABLE=%PROVIDED_PYTHON%
goto run
)
ifexist%DEFAULT_PYTHON% (
setPYTHON_EXECUTABLE=%DEFAULT_PYTHON%
goto run
)
ifnotexist"%PYTHON_EXECUTABLE%" (
echo * Unable to find an installation of Python.
exit /b 1
)
:run
call""%PYTHON_EXECUTABLE%"""%CFG_ROOT_DIR%etc\configure.py"%CFG_CMD_LINE_ARGS%
@rem Return a proper return code on failure
if%errorlevel%neq0 (
exit /b %errorlevel%
)
@rem Activate the virtualenv
endlocal
ifexist"%CFG_ROOT_DIR%Scripts\activate" (
"%CFG_ROOT_DIR%Scripts\activate"
)