From 0434e55c692dfbae3c864a0d45b99a70f5ec2d3b Mon Sep 17 00:00:00 2001 From: 00Fjongl <65314359+00Fjongl@users.noreply.github.com> Date: Wed, 7 Aug 2024 14:21:32 -0500 Subject: [PATCH] Test again for Windows support --- run-command.mjs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/run-command.mjs b/run-command.mjs index 9d5c6593..1842fd90 100644 --- a/run-command.mjs +++ b/run-command.mjs @@ -1,5 +1,5 @@ import { readFile, writeFile, unlink, mkdir, rm } from 'node:fs/promises'; -import { exec, fork } from 'node:child_process'; +import { exec, spawn } from 'node:child_process'; import { fileURLToPath } from 'node:url'; import { build } from 'esbuild'; @@ -27,12 +27,11 @@ for(let i = 2; i < process.argv.length; i++) console.log(stdout); }); else { - const server = fork( - fileURLToPath(new URL("./backend.js", import.meta.url)), - {detached: true} + const server = spawn("node", + [fileURLToPath(new URL("./backend.js", import.meta.url))], + {cwd: process.cwd(), stdio: "inherit", detached: true} ); server.unref(); - server.disconnect(); } break; }