Skip to content

Commit

Permalink
Fix exception when specific files or a directory were removed
Browse files Browse the repository at this point in the history
  • Loading branch information
abmaonline committed May 8, 2018
1 parent 158d1ba commit a45649d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 13 additions & 2 deletions src/bs-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a45649d

Please sign in to comment.