mirror of
https://github.com/dillonkearns/elm-pages.git
synced 2024-09-11 09:05:28 +03:00
39 lines
831 B
JavaScript
Executable File
39 lines
831 B
JavaScript
Executable File
#!/usr/bin/node
|
|
|
|
import * as fs from "node:fs";
|
|
|
|
const currentCompatibilityKey = 22;
|
|
const currentPackageVersion = JSON.parse(
|
|
fs.readFileSync("./package.json")
|
|
).version;
|
|
|
|
fs.writeFileSync(
|
|
"src/Pages/Internal/Platform/CompatibilityKey.elm",
|
|
`module Pages.Internal.Platform.CompatibilityKey exposing (currentCompatibilityKey)
|
|
|
|
|
|
currentCompatibilityKey : Int
|
|
currentCompatibilityKey =
|
|
${currentCompatibilityKey}
|
|
`
|
|
);
|
|
|
|
fs.writeFileSync(
|
|
"generator/src/compatibility-key.js",
|
|
`export const compatibilityKey = ${currentCompatibilityKey};
|
|
|
|
export const packageVersion = "${currentPackageVersion}";
|
|
`
|
|
);
|
|
|
|
fs.writeFileSync(
|
|
"./README.md",
|
|
fs
|
|
.readFileSync("./README.md")
|
|
.toString()
|
|
.replace(
|
|
/Current Compatibility Key: \d+\./,
|
|
`Current Compatibility Key: ${currentCompatibilityKey}.`
|
|
)
|
|
);
|