From 6ad73b8f2ca87ce8a8679951a1d5c4cd993035ab Mon Sep 17 00:00:00 2001 From: Will Chen Date: Sat, 12 Apr 2025 22:39:09 -0700 Subject: [PATCH] fix path --- package-lock.json | 31 +++++++++++++++++++++++++++++++ package.json | 3 ++- src/ipc/handlers/app_handlers.ts | 5 +++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index ac922d7..27bc2c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,6 +40,7 @@ "drizzle-orm": "^0.41.0", "electron-squirrel-startup": "^1.0.1", "esbuild-register": "^3.6.0", + "fix-path": "^4.0.0", "framer-motion": "^12.6.3", "geist": "^1.3.1", "isomorphic-git": "^1.30.1", @@ -12135,6 +12136,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/fix-path": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fix-path/-/fix-path-4.0.0.tgz", + "integrity": "sha512-g31GX207Tt+psI53ZSaB1egprYbEN0ZYl90aKcO22A2LmCNnFsSq3b5YpoKp3E/QEiWByTXGJOkFQG4S07Bc1A==", + "license": "MIT", + "dependencies": { + "shell-path": "^3.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/flat-cache": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", @@ -18069,6 +18085,21 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/shell-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shell-path/-/shell-path-3.0.0.tgz", + "integrity": "sha512-HNIZ+W/3P0JuVTV03xjGqYKt3e3h0/Z4AH8TQWeth1LBtCusSjICgkdNdb3VZr6mI7ijE2AiFFpgkVMNKsALeQ==", + "license": "MIT", + "dependencies": { + "shell-env": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/shell-quote": { "version": "1.8.2", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.2.tgz", diff --git a/package.json b/package.json index ddde848..82d44bc 100644 --- a/package.json +++ b/package.json @@ -89,6 +89,7 @@ "drizzle-orm": "^0.41.0", "electron-squirrel-startup": "^1.0.1", "esbuild-register": "^3.6.0", + "fix-path": "^4.0.0", "framer-motion": "^12.6.3", "geist": "^1.3.1", "isomorphic-git": "^1.30.1", @@ -112,4 +113,4 @@ "update-electron-app": "^3.1.1", "uuid": "^11.1.0" } -} \ No newline at end of file +} diff --git a/src/ipc/handlers/app_handlers.ts b/src/ipc/handlers/app_handlers.ts index d73023b..f1ce646 100644 --- a/src/ipc/handlers/app_handlers.ts +++ b/src/ipc/handlers/app_handlers.ts @@ -32,6 +32,11 @@ import { ALLOWED_ENV_VARS } from "../../constants/models"; import { getEnvVar } from "../utils/read_env"; import { readSettings } from "../../main/settings"; import { Worker } from "worker_threads"; +import fixPath from "fix-path"; + +// Needed, otherwise electron in MacOS/Linux will not be able +// to find "npm". +fixPath(); // Keep track of the static file server worker let staticServerWorker: Worker | null = null;