Update installPythonDeps for windows

This commit is contained in:
David Verdeguer 2020-10-06 14:37:35 +02:00
parent 2748e6c5c1
commit 0f2fa46e3c
3 changed files with 23 additions and 9 deletions

14
lib/init.js generated
View file

@ -123,16 +123,22 @@ async function injectWindowsTracer(processName, processLevel, config, codeql, tr
exports.injectWindowsTracer = injectWindowsTracer;
async function installPythonDeps(codeql, logger) {
logger.startGroup("Setup Python dependencies");
if (process.platform !== "linux") {
logger.info("Currently, auto-installing python dependancies is only supported on linux");
if (process.platform === "darwin") {
logger.info("Currently, auto-installing python dependancies is not supported on MacOS");
logger.endGroup();
return;
}
let install_tools_script = "install_tools.sh";
let auto_install_packages_script = "auto_install_packages.py";
if (process.platform === "win32") {
install_tools_script = "install_tools.ps1";
auto_install_packages_script = "auto_install_packages_windows.py";
}
const scriptsFolder = path.resolve(__dirname, "../python-setup");
// Setup tools on the Github hosted runners
if (process.env["ImageOS"] !== undefined) {
try {
await new toolrunnner.ToolRunner(path.join(scriptsFolder, "install_tools.sh")).exec();
await new toolrunnner.ToolRunner(path.join(scriptsFolder, install_tools_script)).exec();
}
catch (e) {
// This script tries to install some needed tools in the runner. It should not fail, but if it does
@ -143,7 +149,7 @@ async function installPythonDeps(codeql, logger) {
}
// Install dependencies
try {
await new toolrunnner.ToolRunner(path.join(scriptsFolder, "auto_install_packages.py"), [path.dirname(codeql.getPath())]).exec();
await new toolrunnner.ToolRunner(path.join(scriptsFolder, auto_install_packages_script), [path.dirname(codeql.getPath())]).exec();
}
catch (e) {
logger.endGroup();