Introduce more tools for use by plugins

This commit is contained in:
Daniel Vestøl committed 2018-08-10 15:50:46 +02:00
1 parent 3a7527f053
commit 8518cd54c6
7 files changed
+150 -1

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
const fs = require("fs-extra");
const getLua = require("./getLua.js");
let commandCache;
module.exports = async function getCommand(file, COMPRESS = true){
commandCache = commandCache || {};
if(!commandCache[file]){
commandCache[file] = await getLua(file);
return commandCache[file];
} else if(typeof commandCache[file] == "string"){
return commandCache[file];
} else {
throw new Error("Command not found");
}
}