mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-27 01:12:50 +03:00
Improve error output for elm-pages codegen command.
This commit is contained in:
parent
810eb62aac
commit
c3d3909eb5
@ -8,6 +8,7 @@ const init = require("./init.js");
|
||||
const codegen = require("./codegen.js");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const { restoreColorSafe } = require("./error-formatter");
|
||||
|
||||
const commander = require("commander");
|
||||
const { compileCliApp } = require("./compile-elm.js");
|
||||
@ -124,19 +125,22 @@ async function main() {
|
||||
if (!fs.existsSync(expectedFilePath)) {
|
||||
throw `I couldn't find a module named ${expectedFilePath}`;
|
||||
}
|
||||
await codegen.generate("");
|
||||
await runElmCodegenInstall();
|
||||
await compileCliApp(
|
||||
// { debug: true },
|
||||
{},
|
||||
`${splitModuleName.join("/")}.elm`,
|
||||
path.join(process.cwd(), "codegen/elm-stuff/scaffold.js"),
|
||||
// "elm-stuff/scaffold.js",
|
||||
"codegen",
|
||||
try {
|
||||
await codegen.generate("");
|
||||
await runElmCodegenInstall();
|
||||
await compileCliApp(
|
||||
// { debug: true },
|
||||
{},
|
||||
`${splitModuleName.join("/")}.elm`,
|
||||
path.join(process.cwd(), "codegen/elm-stuff/scaffold.js"),
|
||||
"codegen",
|
||||
|
||||
path.join(process.cwd(), "codegen/elm-stuff/scaffold.js")
|
||||
// "elm-stuff/scaffold.js"
|
||||
);
|
||||
path.join(process.cwd(), "codegen/elm-stuff/scaffold.js")
|
||||
);
|
||||
} catch (error) {
|
||||
console.log(restoreColorSafe(error));
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const elmScaffoldProgram = getAt(
|
||||
splitModuleName,
|
||||
|
Loading…
Reference in New Issue
Block a user