diff --git a/package.json b/package.json index 4f380975..7f745ca2 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "main": "backend.js", "scripts": { "start": "npm install && npm run build && npm run manual-start", - "restart": "npm stop ; npm run manual-start", + "restart": "node run-command.mjs stop start", "stop": "node run-command.mjs stop", "test": "npm run proxy-validator", "pm2-start": "pm2 start ecosystem.config.js --env production", diff --git a/run-command.mjs b/run-command.mjs index 737b6a93..9d5c6593 100644 --- a/run-command.mjs +++ b/run-command.mjs @@ -16,7 +16,7 @@ const serverUrl = (base => { return Object.freeze(base); })(); -const shutdown = new URL("./src/.shutdown", import.meta.url); +const shutdown = fileURLToPath(new URL("./src/.shutdown", import.meta.url)); for(let i = 2; i < process.argv.length; i++) switch (process.argv[i]) { @@ -28,7 +28,7 @@ for(let i = 2; i < process.argv.length; i++) }); else { const server = fork( - new URL("./backend.js", import.meta.url), + fileURLToPath(new URL("./backend.js", import.meta.url)), {detached: true} ); server.unref();