travel-agent-cli 0.4.5 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/interactive.jsx +7 -0
- package/package.json +1 -1
package/interactive.jsx
CHANGED
|
@@ -52,8 +52,11 @@ const runPythonCommand = (cmd, args) => {
|
|
|
52
52
|
let error = '';
|
|
53
53
|
|
|
54
54
|
const pythonCmd = findPython();
|
|
55
|
+
|
|
56
|
+
// 使用 shell 启动,让系统查找命令
|
|
55
57
|
const proc = spawn(pythonCmd, [mainPy, cmd, ...args], {
|
|
56
58
|
cwd: pythonDir,
|
|
59
|
+
shell: true,
|
|
57
60
|
});
|
|
58
61
|
|
|
59
62
|
proc.stdout.on('data', (data) => {
|
|
@@ -71,6 +74,10 @@ const runPythonCommand = (cmd, args) => {
|
|
|
71
74
|
reject(error.trim() || '命令执行失败');
|
|
72
75
|
}
|
|
73
76
|
});
|
|
77
|
+
|
|
78
|
+
proc.on('error', (err) => {
|
|
79
|
+
reject(`无法启动 Python: ${err.message}`);
|
|
80
|
+
});
|
|
74
81
|
});
|
|
75
82
|
};
|
|
76
83
|
|