diff --git a/CHANGELOG.md b/CHANGELOG.md index c2548ba..334f30a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # aemfed changelog +## 0.0.3 + +* Fix exception when specific files or a directory were removed + ## 0.0.2 ### Proxy multiple targets diff --git a/README.md b/README.md index 7c4691f..dca6df9 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Once started, connect your browser to the local access URL and port provided by * Works best with a recent version of node/npm, but tested with node 6.x * Tested on AEM 6.1, 6.3 SP1 and 6.3 SP2 -## Isues +## Issues * When sending a clientlib to BrowserSync that is not included in the page, all styling is reloaded. Issue in BrowserSync, will be fixed in future release: [#1505](https://github.com/BrowserSync/browser-sync/issues/1505) * Using ~ (homedir) in paths to watch does not work as expected when aemfed does all the path processing (paths are surrounded with quotes) diff --git a/src/bs-wrapper.ts b/src/bs-wrapper.ts index 421db9a..648aad0 100644 --- a/src/bs-wrapper.ts +++ b/src/bs-wrapper.ts @@ -471,8 +471,19 @@ export function reload(host: string, inputList: string[]): void { csstxtPaths.push(absolutePath); } else { // In packager special files are turned into dirs (.content.xml for example) - const stat = gfs.statSync(absolutePath); - if (stat.isDirectory()) { + let stat; + try { + stat = gfs.statSync(absolutePath); + } catch (err) { + if (err.code === "ENOENT") { + // File not found anymore, thread as special so libs are rebuild + } else { + // Report on other errors + console.error("Error:", absolutePath, err); + } + } + + if (!stat || stat.isDirectory()) { specialPaths.push(absolutePath); } else { other = true;