Skip to content

Commit

Permalink
[Fixes #5297] Upgrade fs-tree-diff
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanpenner committed Jul 12, 2016
1 parent 830fc11 commit 4dac34c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions lib/tasks/server/livereload-server.js
Expand Up @@ -20,8 +20,14 @@ function createServer(options) {
return instance;
}

function isNotDirectory(entry) {
return entry[2] && !entry[2].isDirectory();
function isNotRemoved(entryTuple) {
var operation = entryTuple[0];
return operation !== 'unlink' && operation !== 'rmdir';
}

function isNotDirectory(entryTuple) {
var entry = entryTuple[2];
return entry && !entry.isDirectory();
}

function relativePath(patch) {
Expand Down Expand Up @@ -135,8 +141,9 @@ module.exports = Task.extend({
var files;

if (results.directory) {
this.tree = new FSTree.fromEntries(this.getDirectoryEntries(results.directory));
this.tree = new FSTree.fromEntries(this.getDirectoryEntries(results.directory), { sortAndExpand: true });
files = previousTree.calculatePatch(this.tree)
.filter(isNotRemoved)
.filter(isNotDirectory)
.map(relativePath)
.filter(isNotSourceMapFile);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -48,7 +48,7 @@
"broccoli-concat": "^2.0.4",
"broccoli-config-loader": "^1.0.0",
"broccoli-config-replace": "^1.1.2",
"broccoli-funnel": "^1.0.0",
"broccoli-funnel": "broccolijs/broccoli-funnel#ce16c44",
"broccoli-funnel-reducer": "^1.0.0",
"broccoli-merge-trees": "^1.1.2",
"broccoli-sane-watcher": "^1.1.1",
Expand Down

0 comments on commit 4dac34c

Please sign in to comment.