Use python3 instead of python on non-windows machines.

This commit is contained in:
Viktor Kovacs 2021-04-01 16:25:55 +02:00
parent bb05a22c9e
commit 9ac4415eee
3 changed files with 12 additions and 3 deletions

View File

@ -11,3 +11,4 @@ install:
script:
- npm run test
- npm run build

View File

@ -17,8 +17,8 @@
"test": "mocha test",
"coverage": "nyc mocha test",
"codecov": "nyc --reporter=lcov mocha test && codecov",
"build": "python tools/create_package.py",
"update": "python tools/update_includes.py",
"svg": "python 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"
}
}

8
tools/run_python.js Normal file
View File

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