2022-11-15 22:43:18 +03:00
|
|
|
#!/usr/bin/node
|
|
|
|
|
2023-02-07 21:27:34 +03:00
|
|
|
import * as fs from "node:fs";
|
2022-11-15 22:43:18 +03:00
|
|
|
|
2023-02-09 23:05:02 +03:00
|
|
|
const currentCompatibilityKey = 8;
|
2023-02-07 21:27:34 +03:00
|
|
|
const currentPackageVersion = JSON.parse(
|
|
|
|
fs.readFileSync("./package.json")
|
|
|
|
).version;
|
2022-11-15 22:43:18 +03:00
|
|
|
|
|
|
|
fs.writeFileSync(
|
|
|
|
"src/Pages/Internal/Platform/CompatibilityKey.elm",
|
|
|
|
`module Pages.Internal.Platform.CompatibilityKey exposing (currentCompatibilityKey)
|
|
|
|
|
|
|
|
|
|
|
|
currentCompatibilityKey : Int
|
|
|
|
currentCompatibilityKey =
|
|
|
|
${currentCompatibilityKey}
|
|
|
|
`
|
|
|
|
);
|
|
|
|
|
|
|
|
fs.writeFileSync(
|
2022-11-15 23:00:40 +03:00
|
|
|
"generator/src/compatibility-key.js",
|
2023-02-07 21:27:34 +03:00
|
|
|
`export const compatibilityKey = ${currentCompatibilityKey};
|
|
|
|
|
|
|
|
export const packageVersion = "${currentPackageVersion}";
|
2022-11-15 22:43:18 +03:00
|
|
|
`
|
|
|
|
);
|
|
|
|
|
|
|
|
fs.writeFileSync(
|
|
|
|
"./README.md",
|
|
|
|
fs
|
|
|
|
.readFileSync("./README.md")
|
|
|
|
.toString()
|
|
|
|
.replace(
|
|
|
|
/Current Compatibility Key: \d+\./,
|
|
|
|
`Current Compatibility Key: ${currentCompatibilityKey}.`
|
|
|
|
)
|
|
|
|
);
|