opencode-pixel-office 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/opencode-pixel-office.js +22 -5
- package/package.json +1 -1
|
@@ -319,21 +319,38 @@ const run = async () => {
|
|
|
319
319
|
}
|
|
320
320
|
} catch { }
|
|
321
321
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
322
|
+
// Resolve tsx binary - check multiple locations
|
|
323
|
+
let tsxBin = null;
|
|
324
|
+
const tsxLocations = [
|
|
325
|
+
path.join(serverCwd, "node_modules", ".bin", "tsx"),
|
|
326
|
+
path.join(__dirname, "..", "node_modules", ".bin", "tsx"),
|
|
327
|
+
path.join(DEFAULT_APP_DIR, "node_modules", ".bin", "tsx"),
|
|
328
|
+
];
|
|
329
|
+
for (const loc of tsxLocations) {
|
|
330
|
+
if (fs.existsSync(loc)) {
|
|
331
|
+
tsxBin = loc;
|
|
332
|
+
break;
|
|
327
333
|
}
|
|
328
334
|
}
|
|
335
|
+
if (!tsxBin) {
|
|
336
|
+
// Fallback to PATH
|
|
337
|
+
tsxBin = "tsx";
|
|
338
|
+
}
|
|
329
339
|
|
|
330
340
|
const { spawn } = await import("node:child_process");
|
|
341
|
+
|
|
331
342
|
const child = spawn(tsxBin, [serverScript], {
|
|
332
343
|
cwd: serverCwd,
|
|
333
344
|
env: { ...process.env, PORT: String(port) },
|
|
334
345
|
detached: true,
|
|
335
346
|
stdio: "ignore",
|
|
336
347
|
});
|
|
348
|
+
|
|
349
|
+
child.on("error", (err) => {
|
|
350
|
+
console.error(`Failed to start server: ${err.message}`);
|
|
351
|
+
process.exit(1);
|
|
352
|
+
});
|
|
353
|
+
|
|
337
354
|
child.unref();
|
|
338
355
|
|
|
339
356
|
console.log(`Pixel Office server started on port ${port} (PID: ${child.pid})`);
|