Skip to content

Commit

Permalink
Make sure it outputs 0 files when 0 files are written (avoid "in 0.03…
Browse files Browse the repository at this point in the history
… seconds (v0.11.0)" bug)
  • Loading branch information
zachleat committed May 10, 2020
1 parent 1ce02f5 commit 50d0b5f
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/Eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,12 @@ class Eleventy {
);
}

if (writeCount || skippedCount) {
slashRet.push(
`Wrote ${writeCount} ${simplePlural(writeCount, "file", "files")}${
skippedCount ? ` (skipped ${skippedCount})` : ""
}`
);
}
slashRet.push(
`Wrote ${writeCount} ${simplePlural(writeCount, "file", "files")}${
skippedCount ? ` (skipped ${skippedCount})` : ""
}`
);

if (slashRet.length) {
ret.push(slashRet.join(" / "));
}
Expand Down Expand Up @@ -500,7 +499,7 @@ Arguments:
// Is a CSS input file and is not in the includes folder
// TODO check output path file extension of this template (not input path)
// TODO add additional API for this, maybe a config callback?
let onlyCssChanges = this.watchManager.hasAllQueueFiles(path => {
let onlyCssChanges = this.watchManager.hasAllQueueFiles((path) => {
return (
path.endsWith(".css") &&
// TODO how to make this work with relative includes?
Expand Down Expand Up @@ -627,7 +626,7 @@ Arguments:
return Object.assign(
{
ignored: ignores,
ignoreInitial: true
ignoreInitial: true,
// also interesting: awaitWriteFinish
},
configOptions
Expand Down Expand Up @@ -684,12 +683,12 @@ Arguments:
}
}

watcher.on("change", async path => {
watcher.on("change", async (path) => {
console.log("File changed:", path);
await watchRun.call(this, path);
});

watcher.on("add", async path => {
watcher.on("add", async (path) => {
console.log("File added:", path);
await watchRun.call(this, path);
});
Expand Down

0 comments on commit 50d0b5f

Please sign in to comment.