Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. diff --git a/lib/buildlist.js b/lib/buildlist.js
  2. index 2aaf39c..1d9fea4 100644
  3. --- a/lib/buildlist.js
  4. +++ b/lib/buildlist.js
  5. @@ -40,4 +40,19 @@ Buildlist.prototype.reload = function() {
  6. return delta;
  7. };
  8.  
  9. +Buildlist.prototype.filterNonExisting = function() {
  10. + var deleting = [];
  11. + this.list.forEach(function (ident, i) {
  12. + var mypath = path.join(this.baseUrl, ident + '.js');
  13. + if (!fs.existsSync(mypath)) {
  14. + deleting.push(i);
  15. + }
  16. + });
  17. + deleting.reverse();
  18. + deleting.forEach(function (i) {
  19. + this.list.splice(i, 1);
  20. + });
  21. + return this.list;
  22. +};
  23. +
  24. module.exports = Buildlist;
  25. diff --git a/watcher.js b/watcher.js
  26. index bac35dd..c0bacf3 100644
  27. --- a/watcher.js
  28. +++ b/watcher.js
  29. @@ -212,6 +212,9 @@ var buildlist = new Buildlist({
  30. baseUrl: baseUrl
  31. });
  32.  
  33. +console.log(buildlist.filterNonExisting().length);
  34. +process.exit(0);
  35. +
  36. var buildQueue = new BuildQueue({
  37. log: log,
  38. fs: fileSystem,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement