mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 15:14:52 +09:00
Introduce more tools for use by plugins
This commit is contained in:
1 parent
3a7527f053
commit
8518cd54c6
7 files changed
+150
-1
No files matched your search
+16
@@ -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");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user