Testing pterodactyl compile support!

This commit is contained in:
DJj123dj
2024-09-01 11:58:16 +02:00
parent e410ceaa64
commit 147eae05b3
2 changed files with 10 additions and 11 deletions
+6 -6
View File
@@ -2,14 +2,14 @@
//OR USE "npm start" TO INSTANTLY COMPILE & START THE BOT! //OR USE "npm start" TO INSTANTLY COMPILE & START THE BOT!
const fs = require("fs") const fs = require("fs")
const child = require("child_process") if (process.argv.includes("-%-compile")){
console.log("Removing prebuilds...") console.log("Removing prebuilds...")
fs.rmSync("./dist",{recursive:true,force:true}) fs.rmSync("./dist",{recursive:true,force:true})
console.log("Compiling the bot...") console.log("Compiling the bot...")
//exit when only compilation is required //exit on compilation
if (process.argv.includes("-%-compile")) process.exit(0) process.exit(0)
}
//start the bot //start the bot
require("./dist/src/index") console.log("Finished compilation!")
import("./dist/src/index.js")
+1 -2
View File
@@ -12,8 +12,7 @@
], ],
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"build": "node index.js -%-compile && npx tsc -p ./tsconfig.json", "start": "node index.js -%-compile && npx tsc -p ./tsconfig.json && node index.js",
"start": "npm run build && node ./dist/src/index.js",
"test": "npm run start -- --dev-config --dev-database" "test": "npm run start -- --dev-config --dev-database"
}, },
"type": "commonjs", "type": "commonjs",