diff --git a/options.json b/options.json index b23e5bf..704a8bf 100644 --- a/options.json +++ b/options.json @@ -2,7 +2,8 @@ "rootDir": "Should be overwritten in index.ts", "shardOptions": { "totalShards": "auto", - "respawn": true + "respawn": true, + "execArgv": ["--enable-source-maps"] }, "discord": { "prefix": "!", diff --git a/package.json b/package.json index 15beee9..ef88697 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "debug": "node --trace-warnings --inspect index.js", "update": "git pull && cd api && yarn update", "test": "jest --detectOpenHandles", - "lint": "eslint --fix src/**", + "lint": "eslint --fix src/", "build": "tsc --build" }, "repository": { diff --git a/src/middleware/Controller.ts b/src/middleware/Controller.ts index c210cac..fd46b08 100644 --- a/src/middleware/Controller.ts +++ b/src/middleware/Controller.ts @@ -53,7 +53,7 @@ class Controller extends EventEmitter throw new Error(`Client path does not seem to exist: ${clientPath}`); this.#options = options; - const { shardList, totalShards } = Controller.parseShardOptions(options.shardOptions); + const { shardList, totalShards, execArgv } = Controller.parseShardOptions(options.shardOptions); options.discord.rootDir = options.rootDir; options.discord.logger = options.logger; @@ -65,7 +65,7 @@ class Controller extends EventEmitter shardList, respawn, shardArgs: [], - execArgv: [], + execArgv, token: process.env.DISCORD_TOKEN, clientOptions: options.discord, }; @@ -346,7 +346,11 @@ class Controller extends EventEmitter if (!Number.isInteger(totalShards)) throw new Error('TotalShards must be an integer.'); } - return { shardList, totalShards }; + + let { execArgv } = options; + if (!execArgv) + execArgv = []; + return { shardList, totalShards, execArgv }; } get version ()