mirror of
https://github.com/lmstudio-ai/lms.git
synced 2025-07-30 13:32:37 +08:00
Update cwd
This commit is contained in:
@ -40,6 +40,7 @@ type PluginProcessStatus = "stopped" | "running" | "restarting";
|
|||||||
|
|
||||||
class PluginProcess {
|
class PluginProcess {
|
||||||
public constructor(
|
public constructor(
|
||||||
|
private readonly cwd: string,
|
||||||
private readonly executable: string,
|
private readonly executable: string,
|
||||||
private readonly args: Array<string>,
|
private readonly args: Array<string>,
|
||||||
private readonly env: Record<string, string>,
|
private readonly env: Record<string, string>,
|
||||||
@ -55,6 +56,7 @@ class PluginProcess {
|
|||||||
FORCE_COLOR: "1",
|
FORCE_COLOR: "1",
|
||||||
...this.env,
|
...this.env,
|
||||||
},
|
},
|
||||||
|
cwd: this.cwd,
|
||||||
});
|
});
|
||||||
this.currentProcess.on("exit", (code, signal) => {
|
this.currentProcess.on("exit", (code, signal) => {
|
||||||
if (code !== null) {
|
if (code !== null) {
|
||||||
@ -132,11 +134,12 @@ export const dev = command({
|
|||||||
const watcher = new EsPluginRunnerWatcher(new Esbuild(), cwd(), logger);
|
const watcher = new EsPluginRunnerWatcher(new Esbuild(), cwd(), logger);
|
||||||
|
|
||||||
const pluginProcess = new PluginProcess(
|
const pluginProcess = new PluginProcess(
|
||||||
|
projectPath,
|
||||||
process.platform === "win32" ? "node.exe" : "node",
|
process.platform === "win32" ? "node.exe" : "node",
|
||||||
["--enable-source-maps", join(projectPath, ".lmstudio", "dev.js")],
|
["--enable-source-maps", join(".lmstudio", "dev.js")],
|
||||||
{
|
{
|
||||||
LMS_CLIENT_IDENTIFIER: `dev-plugin-${manifest.owner}/${manifest.name}`,
|
LMS_PLUGIN_CLIENT_IDENTIFIER: `dev-plugin-${manifest.owner}/${manifest.name}`,
|
||||||
LMS_CLIENT_PASSKEY: `dev-plugin-${manifest.owner}/${manifest.name}`,
|
LMS_PLUGIN_CLIENT_PASSKEY: `dev-plugin-${manifest.owner}/${manifest.name}`,
|
||||||
},
|
},
|
||||||
pluginServerLogger,
|
pluginServerLogger,
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user