travel-agent-cli 0.4.0 → 0.4.2
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/bin/cli.js +2 -2
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -37,11 +37,11 @@ function getVenvPython() {
|
|
|
37
37
|
|
|
38
38
|
// 检查 Python 是否可用
|
|
39
39
|
function findPython() {
|
|
40
|
+
const { execSync } = require('child_process');
|
|
40
41
|
const candidates = ['python3', 'python'];
|
|
41
42
|
|
|
42
43
|
for (const cmd of candidates) {
|
|
43
44
|
try {
|
|
44
|
-
const { execSync } = await import('child_process');
|
|
45
45
|
execSync(`${cmd} --version`, { stdio: 'ignore' });
|
|
46
46
|
return cmd;
|
|
47
47
|
} catch (e) {
|
|
@@ -135,7 +135,7 @@ function run() {
|
|
|
135
135
|
|
|
136
136
|
// 如果没有虚拟环境,使用系统 Python
|
|
137
137
|
if (!pythonCmd) {
|
|
138
|
-
pythonCmd =
|
|
138
|
+
pythonCmd = findPython();
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
if (!pythonCmd) {
|