Skip to content

Commit d12f3bb

Browse files
committed
feat: 自动发现 Auto-Claude 后端 Python 虚拟环境路径
1 parent 09fea7c commit d12f3bb

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

apps/frontend/src/main/ipc-handlers/settings-handlers.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,27 @@ export function registerSettingsHandlers(
270270
path.join(app.getPath('home'), 'opt/anaconda3/bin/python3'),
271271
];
272272

273+
// Also check for Auto-Claude backend venv (relative to app location)
274+
const autoBuildVenvPaths = [
275+
// Development mode: from apps/frontend/out/main -> apps/backend/.venv
276+
path.resolve(__dirname, '..', '..', '..', 'backend', '.venv', 'bin', 'python'),
277+
// Alternative: from app root -> apps/backend/.venv
278+
path.resolve(app.getAppPath(), '..', 'backend', '.venv', 'bin', 'python'),
279+
// If running from repo root
280+
path.resolve(process.cwd(), 'apps', 'backend', '.venv', 'bin', 'python'),
281+
];
282+
283+
for (const venvPath of autoBuildVenvPaths) {
284+
try {
285+
if (existsSync(venvPath)) {
286+
paths.add(venvPath);
287+
break; // Only add first found venv
288+
}
289+
} catch {
290+
// Ignore errors
291+
}
292+
}
293+
273294
for (const loc of commonLocations) {
274295
try {
275296
if (existsSync(loc)) {

0 commit comments

Comments
 (0)