Unverified 提交 acf7a56b authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo 提交者: GitHub

Use given PYTHON env variable (if given) when running worker/scripts/getmake.py (#1186)

上级 ef1b6b06
......@@ -4,6 +4,7 @@
### NEXT
* CI: Use Node.js version 20 ([PR #1177](https://github.com/versatica/mediasoup/pull/1177)).
* Use given `PYTHON` environment variable (if given) when running `worker/scripts/getmake.py` ([PR #1186](https://github.com/versatica/mediasoup/pull/1186)).
### 3.12.13
......
......@@ -418,21 +418,34 @@ function installMsysMake()
{
logInfo('installMsysMake()');
let res = spawnSync('where', [ 'python3.exe' ]);
let pythonPath;
if (res.status !== 0)
// If PYTHON environment variable is given, use it.
if (process.env.PYTHON)
{
res = spawnSync('where', [ 'python.exe' ]);
pythonPath = process.env.PYTHON;
}
// Otherwise ensure python3.exe is available in the PATH.
else
{
let res = spawnSync('where', [ 'python3.exe' ]);
if (res.status !== 0)
{
logError('`installMsysMake() | cannot find Python executable');
res = spawnSync('where', [ 'python.exe' ]);
exitWithError();
if (res.status !== 0)
{
logError('`installMsysMake() | cannot find Python executable');
exitWithError();
}
}
pythonPath = String(res.stdout).trim();
}
executeCmd(`${String(res.stdout).trim()} worker\\scripts\\getmake.py`);
executeCmd(`${pythonPath} worker\\scripts\\getmake.py`);
}
function ensureDir(dir)
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论