mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2025-01-05 12:57:33 +03:00
Give an error if elm-review isn't found on the PATH.
This commit is contained in:
parent
87b60e4856
commit
f40e1d0db2
@ -47,6 +47,11 @@ async function ensureRequiredExecutables() {
|
||||
} catch (error) {
|
||||
throw "I couldn't find elm-optimize-level-2 on the PATH. Please ensure it's installed, either globally, or locally. If it's installed locally, ensure you're running through an NPM script or with npx so the PATH is configured to include it.";
|
||||
}
|
||||
try {
|
||||
await which("elm-review");
|
||||
} catch (error) {
|
||||
throw "I couldn't find elm-review on the PATH. Please ensure it's installed, either globally, or locally. If it's installed locally, ensure you're running through an NPM script or with npx so the PATH is configured to include it.";
|
||||
}
|
||||
}
|
||||
|
||||
async function run(options) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
const which = require("which");
|
||||
const chokidar = require("chokidar");
|
||||
const {
|
||||
spawnElmMake,
|
||||
@ -49,6 +50,12 @@ async function start(options) {
|
||||
});
|
||||
|
||||
await codegen.generate(options.base);
|
||||
try {
|
||||
await ensureRequiredExecutables();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
}
|
||||
let clientElmMakeProcess = compileElmForBrowser();
|
||||
let pendingCliCompile = compileCliApp();
|
||||
watchElmSourceDirs(true);
|
||||
@ -521,4 +528,17 @@ function errorHtml() {
|
||||
`;
|
||||
}
|
||||
|
||||
async function ensureRequiredExecutables() {
|
||||
try {
|
||||
await which("elm");
|
||||
} catch (error) {
|
||||
throw "I couldn't find elm on the PATH. Please ensure it's installed, either globally, or locally. If it's installed locally, ensure you're running through an NPM script or with npx so the PATH is configured to include it.";
|
||||
}
|
||||
try {
|
||||
await which("elm-review");
|
||||
} catch (error) {
|
||||
throw "I couldn't find elm-review on the PATH. Please ensure it's installed, either globally, or locally. If it's installed locally, ensure you're running through an NPM script or with npx so the PATH is configured to include it.";
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { start };
|
||||
|
Loading…
Reference in New Issue
Block a user