elm-pages-v3-beta/update-compatibility-keys.js
2022-11-15 11:43:18 -08:00

34 lines
680 B
JavaScript
Executable File

#!/usr/bin/node
const fs = require("fs");
const currentCompatibilityKey = 1;
fs.writeFileSync(
"src/Pages/Internal/Platform/CompatibilityKey.elm",
`module Pages.Internal.Platform.CompatibilityKey exposing (currentCompatibilityKey)
currentCompatibilityKey : Int
currentCompatibilityKey =
${currentCompatibilityKey}
`
);
fs.writeFileSync(
"generator/compatibility-key.js",
`module.exports = { compatibilityKey: ${currentCompatibilityKey} };
`
);
fs.writeFileSync(
"./README.md",
fs
.readFileSync("./README.md")
.toString()
.replace(
/Current Compatibility Key: \d+\./,
`Current Compatibility Key: ${currentCompatibilityKey}.`
)
);