Skip to content

Commit 1999046

Browse files
committed
Revert "Sanitize whitespaces in python invocation"
This reverts commit c244f07.
1 parent c244f07 commit 1999046

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

libs/odmRunner.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,13 @@ module.exports = {
122122
return; // Skip rest
123123
}
124124

125-
const getOdmOptions = (pythonExe, useShell, done) => {
125+
const getOdmOptions = (pythonExe, done) => {
126126
// Launch
127127
const env = utils.clone(process.env);
128128
env.ODM_OPTIONS_TMP_FILE = utils.tmpPath(".json");
129129
env.ODM_PATH = config.odm_path;
130-
const helper = path.join(__dirname, "..", "helpers", "odmOptionsToJson.py");
131-
const helperSanitized = useShell ? `"${helper}"` : helper;
132-
const odmSanitized = useShell ? `"${config.odm_path}"` : config.odm_path;
133-
let childProcess = spawn(pythonExe, [helperSanitized,
134-
"--project-path", odmSanitized, "bogusname"], { env, stdio: 'inherit', shell: useShell });
130+
let childProcess = spawn(pythonExe, [path.join(__dirname, "..", "helpers", "odmOptionsToJson.py"),
131+
"--project-path", config.odm_path, "bogusname"], { env, stdio: 'inherit', shell: true });
135132

136133
// Cleanup on done
137134
let handleResult = (err, result) => {
@@ -163,11 +160,11 @@ module.exports = {
163160
}
164161

165162
if (os.platform() === "win32"){
166-
getOdmOptions("helpers\\odm_python.bat", true, done);
163+
getOdmOptions("helpers\\odm_python.bat", done);
167164
}else{
168165
// Try Python3 first
169-
getOdmOptions("python3", false, (err, result) => {
170-
if (err) getOdmOptions("python", false, done);
166+
getOdmOptions("python3", (err, result) => {
167+
if (err) getOdmOptions("python", done);
171168
else done(null, result);
172169
});
173170
}

0 commit comments

Comments
 (0)