Skip to content

Latest commit

History

71 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

lua-glob

Build status

Install: copy "glob.lua" directory to your project, or use luarocks luarocks install lua-glob --server=https://luarocks.org/dev

glob

localglob=require'glob'localpattern= {
'src',
'!*.dll',
}
localoptions= {
ignoreCase=true
}
localparser=glob.glob(pattern, options)
parser'Src/main.lua' --> trueparser'Src/lpeg.dll' --> false

gitignore

match

localglob=require'glob'localpattern= {
'src/*',
'!*.dll',
}
localoptions= {
ignoreCase=true
}
localparser=glob.gitignore(pattern, options)
parser'Src/main.lua' --> trueparser'Src/lpeg.dll' --> false

scan

Work space

main.lua
utility.lua
src
|---test.lua
|---bee.dll
|---lua.dll
localglob=require'glob'localfs=require'bee.filesystem' -- just another filesystemlocalpattern= {
'src/*',
'!*.dll',
}
localoptions= {
ignoreCase=true
}
localinterface= {
type=function (path)
ifnotfs.exists(fs.path(path)) thenreturnnilendiffs.is_directory(fs.path(path)) thenreturn'directory'elsereturn'file'endend,
list=function (path)
ifnotfs.exists(fs.path(path)) thenreturnnilendifnotfs.is_directory(fs.path(path)) thenreturnnilendlocalchilds= {}
forchildinfs.path(path):list_directory() dochilds[#childs+1] =child:string()
endreturnchildsend,
}
localparser=glob.gitignore(pattern, options, interface)
localfiles=parser:scan()
print(files[1]) --> main.luaprint(files[2]) --> utility.luaprint(files[3]) --> src\bee.dllprint(files[4]) --> src\lua.dllprint(files[5]) --> nil

About

No description or website provided.

Topics

Resources

Stars

14 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages