Generate Template.elm module.

This commit is contained in:
Dillon Kearns 2020-10-26 11:03:43 -07:00
parent 3aa978578b
commit b26d05b88c
4 changed files with 6 additions and 0 deletions

View File

@ -47,6 +47,11 @@ async function writeFiles(markdownContent) {
ensureDirSync("./elm-stuff");
ensureDirSync("./gen");
ensureDirSync("./elm-stuff/elm-pages");
fs.copyFileSync(path.join(__dirname, `./Template.elm`), `./gen/Template.elm`);
fs.copyFileSync(
path.join(__dirname, `./Template.elm`),
`./elm-stuff/elm-pages/Template.elm`
);
// prevent compilation errors if migrating from previous elm-pages version
deleteIfExists("./elm-stuff/elm-pages/Pages/ContentCache.elm");

View File

@ -36,6 +36,7 @@ module.exports = function run(mode, staticRoutes, markdownContent) {
global.previousUiFileContent = uiFileContent;
fs.copyFileSync(path.join(__dirname, `./Template.elm`), `./gen/Template.elm`);
// write `Pages.elm` with cli interface
fs.writeFileSync(
"./elm-stuff/elm-pages/Pages.elm",