aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/lfs_ext.lua
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2016-07-04 22:00:22 -0400
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2016-07-04 22:00:22 -0400
commit033ff6510da63d87582c00b297bb5cb32c3eeac4 (patch)
tree946cca6a3ca65c0145b3e6f7785acef3b6671fe6 /core/lfs_ext.lua
parent5a6b12358d5013f294b962ccd0614dbf4447348b (diff)
Fixed inability to effectively halt `lfs.dir_foreach()` loops; core/lfs_ext.lua
Diffstat (limited to 'core/lfs_ext.lua')
-rw-r--r--core/lfs_ext.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/lfs_ext.lua b/core/lfs_ext.lua
index deaf0e89..7a4614f1 100644
--- a/core/lfs_ext.lua
+++ b/core/lfs_ext.lua
@@ -18,7 +18,7 @@ lfs.default_filter = {
'a', 'bmp', 'bz2', 'class', 'dll', 'exe', 'gif', 'gz', 'jar', 'jpeg', 'jpg',
'o', 'pdf', 'png', 'so', 'tar', 'tgz', 'tif', 'tiff', 'xz', 'zip'
},
- folders = {'%.bzr$', '%.git$', '%.hg$', '%.svn$'}
+ folders = {'%.bzr$', '%.git$', '%.hg$', '%.svn$', 'node_modules'}
}
local lfs_symlinkattributes = lfs.symlinkattributes
@@ -92,10 +92,12 @@ function lfs.dir_foreach(dir, f, filter, n, include_dirs, level)
if mode == 'directory' and not exclude(filename, filter.folders) then
if include_dirs and f(filename..dir_sep) == false then return end
if not n or level < n then
- lfs.dir_foreach(filename, f, filter, n, include_dirs, level + 1)
+ local halt = lfs.dir_foreach(filename, f, filter, n, include_dirs,
+ level + 1) == false
+ if halt then return false end
end
elseif mode == 'file' and not exclude(filename, filter) then
- if f(filename) == false then return end
+ if f(filename) == false then return false end
end
end
end