created cleardatabase system
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
const fs = require('fs')
|
||||||
|
|
||||||
|
const dataPaths = ["./storage/tickets","./storage/transcripts","./storage/userTickets"]
|
||||||
|
|
||||||
|
var index = 0
|
||||||
|
|
||||||
|
dataPaths.forEach((path) => {
|
||||||
|
try {
|
||||||
|
fs.rmdirSync(path,{recursive:true,force:true})
|
||||||
|
}catch{
|
||||||
|
console.log(path,"doesn't exist")
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
try{
|
||||||
|
fs.mkdirSync(path)
|
||||||
|
}catch{
|
||||||
|
console.log(path,"already exists")
|
||||||
|
}
|
||||||
|
index++
|
||||||
|
},500)
|
||||||
|
})
|
||||||
|
|
||||||
|
setInterval(() => {
|
||||||
|
if (index >= 3){
|
||||||
|
console.log("All local data is cleared!")
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
},500)
|
||||||
+2
-1
@@ -7,7 +7,8 @@
|
|||||||
"start": "node index.js",
|
"start": "node index.js",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"slashEnable":"node index.js slash enable",
|
"slashEnable":"node index.js slash enable",
|
||||||
"slashDisable":"node index.js slash disable"
|
"slashDisable":"node index.js slash disable",
|
||||||
|
"cleardata":"node ./core/dynamicdatabase/cleardata.js"
|
||||||
},
|
},
|
||||||
"author": "DJdj Development",
|
"author": "DJdj Development",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
1
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
0
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
858640346892337163
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
779742674932072469
|
|
||||||
Reference in New Issue
Block a user