Run the correct python version with a node.js script.

This commit is contained in:
Viktor Kovacs 2021-05-12 20:09:52 +02:00
parent fef0d8070c
commit 6baf5b4767
2 changed files with 16 additions and 3 deletions

View File

@ -15,8 +15,8 @@
"scripts": {
"test": "mocha test",
"coverage": "nyc mocha test",
"build": "py -3 tools/create_package.py",
"update": "py -3 tools/update_includes.py",
"svg": "py -3 tools/optimize_svg_files.py"
"build": "node tools/run_python.js tools/create_package.py",
"update": "node tools/run_python.js tools/update_includes.py",
"svg": "node tools/run_python.js tools/optimize_svg_files.py"
}
}

13
tools/run_python.js Normal file
View File

@ -0,0 +1,13 @@
let childProcess = require ('child_process');
let pythonExecutable = 'python';
if (process.platform !== 'win32') {
pythonExecutable = 'python3';
}
let args = process.argv.slice (2);
let result = childProcess.spawnSync (pythonExecutable, args, {
stdio: "inherit"
});
process.exit (result.status);