From 147eae05b361d0a056df45f2394ede72c8090758 Mon Sep 17 00:00:00 2001 From: DJj123dj <80536295+DJj123dj@users.noreply.github.com> Date: Sun, 1 Sep 2024 11:58:16 +0200 Subject: [PATCH] Testing pterodactyl compile support! --- index.js | 18 +++++++++--------- package.json | 3 +-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/index.js b/index.js index 5f2ba69..a35c823 100644 --- a/index.js +++ b/index.js @@ -2,14 +2,14 @@ //OR USE "npm start" TO INSTANTLY COMPILE & START THE BOT! const fs = require("fs") -const child = require("child_process") - -console.log("Removing prebuilds...") -fs.rmSync("./dist",{recursive:true,force:true}) - -console.log("Compiling the bot...") -//exit when only compilation is required -if (process.argv.includes("-%-compile")) process.exit(0) +if (process.argv.includes("-%-compile")){ + console.log("Removing prebuilds...") + fs.rmSync("./dist",{recursive:true,force:true}) + console.log("Compiling the bot...") + //exit on compilation + process.exit(0) +} //start the bot -require("./dist/src/index") \ No newline at end of file +console.log("Finished compilation!") +import("./dist/src/index.js") \ No newline at end of file diff --git a/package.json b/package.json index 06785c7..5a72c56 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,7 @@ ], "main": "index.js", "scripts": { - "build": "node index.js -%-compile && npx tsc -p ./tsconfig.json", - "start": "npm run build && node ./dist/src/index.js", + "start": "node index.js -%-compile && npx tsc -p ./tsconfig.json && node index.js", "test": "npm run start -- --dev-config --dev-database" }, "type": "commonjs",