From 0b2003d9f871c1b3ba728f8f5f2d6e3721fbaa39 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 30 Oct 2025 00:45:45 -0500 Subject: [PATCH] Fix shell tool paths --- package.json | 2 +- src/components/Terminal.tsx | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 56b32f7d..b3f09dc2 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "build": "npm i --silent && vite build -l error && cp dist/index.html dist/404.html && echo 'Project built successfully!'", "typecheck": "npm i --silent && tsc --noEmit", "test": "npm i --silent && eslint && vitest run --reporter=dot --silent && echo 'All tests passed!'", - "electron": "electron electron", + "electron": "npm run build && rm -rf electron/dist && cp -r dist electron/dist && electron electron", "electron:publish": "npm run build && node scripts/prepare-electron-publish.js && cd electron && npm publish" }, "dependencies": { diff --git a/src/components/Terminal.tsx b/src/components/Terminal.tsx index d7f277fd..cdcf73d8 100644 --- a/src/components/Terminal.tsx +++ b/src/components/Terminal.tsx @@ -104,18 +104,10 @@ export function Terminal({ projectId, className }: TerminalProps) { // Check if running in Electron - use real shell if (window.electron?.shell) { - // Get relative path from projects root - // Remove the projectsPath prefix to get the relative path for the OS - const projectsPrefix = projectsPath.endsWith('/') - ? projectsPath - : projectsPath + '/'; - + // Use the full path (with ~ if present) - Electron will expand it const fullCwd = `${projectsPath}/${projectId}`; - const relativeCwd = fullCwd.startsWith(projectsPrefix) - ? fullCwd.substring(projectsPrefix.length) - : fullCwd; - const result = await window.electron.shell.exec(command, relativeCwd); + const result = await window.electron.shell.exec(command, fullCwd); // Format output let output = '';