From 9ac4415eee6c3125855cf887977042315f51ad51 Mon Sep 17 00:00:00 2001 From: Viktor Kovacs Date: Thu, 1 Apr 2021 16:25:55 +0200 Subject: [PATCH] Use python3 instead of python on non-windows machines. --- .travis.yml | 1 + package.json | 6 +++--- tools/run_python.js | 8 ++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 tools/run_python.js diff --git a/.travis.yml b/.travis.yml index ceb907c..29fcff7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,3 +11,4 @@ install: script: - npm run test + - npm run build diff --git a/package.json b/package.json index 6eef821..0f8a016 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/tools/run_python.js b/tools/run_python.js new file mode 100644 index 0000000..9b8f76c --- /dev/null +++ b/tools/run_python.js @@ -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" +});