fix: use import.meta.url for cross-platform script path resolution
Hardcoded Windows path broke Linux/macOS startup. Use import.meta.url to derive the script path relative to the compiled JS, with KICAD_SCRIPT_PATH env override for custom installs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,8 +24,8 @@ class KiCADServer {
|
||||
|
||||
constructor() {
|
||||
// Set absolute path to the Python KiCAD interface script
|
||||
// Using a hardcoded path to avoid cwd() issues when running from Cline
|
||||
this.kicadScriptPath = "c:/repo/KiCAD-MCP/python/kicad_interface.py";
|
||||
this.kicadScriptPath = process.env.KICAD_SCRIPT_PATH ||
|
||||
path.join(path.dirname(new URL(import.meta.url).pathname), "../python/kicad_interface.py");
|
||||
|
||||
// Check if script exists
|
||||
if (!existsSync(this.kicadScriptPath)) {
|
||||
|
||||
Reference in New Issue
Block a user