Skip to content

Commit

Permalink
Small revert for #3361
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Jul 12, 2024
1 parent f19ef55 commit a50dd0a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cmd.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ const debug = require("debug")("Eleventy:cmd");
}

try {
if (argv.serve) {
let shouldStartServer = true;
if (argv.serve || argv.watch) {
let shouldStartServer = argv.serve;

elev
.watch()
.then(() => {
Expand All @@ -113,10 +114,11 @@ const debug = require("debug")("Eleventy:cmd");
// A build error occurred and we aren’t going to --serve
errorHandler.fatal(e, "Eleventy CLI Error");
});
} else if (argv.watch) {
elev.watch().catch((e) => {
// A build error occurred and we aren’t going to --watch
errorHandler.fatal(e, "Eleventy CLI Error");

process.on("SIGINT", async () => {
// stops the server too
await elev.stopWatch();
process.exit();
});
} else {
if (argv.to === "json") {
Expand Down

0 comments on commit a50dd0a

Please sign in to comment.