Fixed permission error & preparing for win build
This commit is contained in:
@@ -3,9 +3,13 @@
|
||||
|
||||
const fs = require("fs")
|
||||
const child = require("child_process")
|
||||
if (!fs.existsSync("./dist/src/index.js")){
|
||||
console.log("Compiling the bot...")
|
||||
child.execSync("npm run build")
|
||||
console.log("\n\nFinished compilation!")
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
//start the bot
|
||||
require("./dist/src/index")
|
||||
Reference in New Issue
Block a user