From bf6df2b0e84a94757e97ff5ccfa4a464e6486128 Mon Sep 17 00:00:00 2001 From: SillyLossy Date: Tue, 16 May 2023 20:35:46 +0300 Subject: [PATCH] Change relative path handling --- server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index d6057307e..9aa926300 100644 --- a/server.js +++ b/server.js @@ -21,7 +21,9 @@ const cliArguments = yargs(hideBin(process.argv)) // change all relative paths const path = require('path'); -process.chdir(path.dirname(process.execPath)); +const directory = process.pkg ? path.dirname(process.execPath) : __dirname; +console.log(process.pkg ? 'Running from binary' : 'Running from source'); +process.chdir(directory); const express = require('express'); const compression = require('compression');