diff --git a/_PostExitHooks/Post-Exit-Init.bat b/_PostExitHooks/Post-Exit-Init.bat new file mode 100644 index 0000000..f817c4a --- /dev/null +++ b/_PostExitHooks/Post-Exit-Init.bat @@ -0,0 +1,3 @@ +@echo off +cd .devtools +node ./UpdateVersion.js diff --git a/_PostExitHooks/UpdateVersion.js b/_PostExitHooks/UpdateVersion.js new file mode 100644 index 0000000..d92841c --- /dev/null +++ b/_PostExitHooks/UpdateVersion.js @@ -0,0 +1,24 @@ +const fs = require("node:fs"); +const path = require("node:path"); + +const CurrentDate = new Date(); + +function ZeroPadding(input) { + if (input.toString().length == 1) { + return `0${input}`; + } + return input; +} + +const DateVersion = `${CurrentDate.getFullYear()}/${ZeroPadding(CurrentDate.getMonth() + 1)}/${ZeroPadding( + CurrentDate.getDate() +)}-${ZeroPadding(CurrentDate.getHours())}:${ZeroPadding(CurrentDate.getMinutes())}`; + +const BetterCompatibilityCheckerConfig = { + projectID: 58139301, + modpackName: "smclt", + modpackVersion: DateVersion, + useMetadata: false, +}; + +fs.writeFileSync(path.relative(process.cwd(), "../config/bcc.json"), JSON.stringify(BetterCompatibilityCheckerConfig));