diff --git a/scripts/rights.js b/scripts/rights.js index a6d23855..5ae576ef 100644 --- a/scripts/rights.js +++ b/scripts/rights.js @@ -12,7 +12,7 @@ let lines3 = lines2.filter((y) => y.includes(": BitFlag(")); let lines4 = lines3.map((x) => x.split("//")[0].trim()); function BitFlag(int) { - return 1n << eval(`${int}n`); + return 1n << BigInt(int); } let rights = []; diff --git a/src/plugins/PluginIndex.ts b/src/plugins/PluginIndex.ts index 502161a1..2688d0bf 100644 --- a/src/plugins/PluginIndex.ts +++ b/src/plugins/PluginIndex.ts @@ -1,6 +1,5 @@ -import { Plugin } from "util/plugin"; import * as example_plugin from "./example-plugin/TestPlugin"; export const PluginIndex: any = { - "example-plugin": new example_plugin.default(), -}; \ No newline at end of file + "example-plugin": new example_plugin.default() +}; diff --git a/src/util/util/Config.ts b/src/util/util/Config.ts index 49a1f3f8..2879b955 100644 --- a/src/util/util/Config.ts +++ b/src/util/util/Config.ts @@ -5,6 +5,7 @@ import { ConfigValue } from "../config"; import { ConfigEntity } from "../entities/Config"; const overridePath = process.env.CONFIG_PATH ?? ""; +const initialPath = path.join(process.cwd(), "initial.json"); let config: ConfigValue; let pairs: ConfigEntity[]; @@ -28,6 +29,14 @@ export const Config = { } catch (error) { fs.writeFileSync(overridePath, JSON.stringify(config, null, 4)); } + if (fs.existsSync(initialPath)) { + console.log("[Config] Importing initial configuration..."); + try { + const overrideConfig = JSON.parse(fs.readFileSync(initialPath, { encoding: "utf8" })); + config = overrideConfig.merge(config); + fs.rmSync(initialPath); + } catch (error) {} + } if (fs.existsSync(path.join(process.cwd(), "initial.json"))) try {