fix(bin/linja.in): recursively find all files in a pattern endswith /
Example: If you have an entry in .project file such as - theories/ It will remove all files under 'theories' directory from the project related issue: leanprover/lean.js#3
This commit is contained in:
parent
ed41a01a51
commit
8c1cd92add
1 changed files with 7 additions and 2 deletions
|
@ -551,9 +551,14 @@ def get_lean_names(lean_file, args, using_hlean):
|
|||
item['clean'] = args.cache
|
||||
return item
|
||||
|
||||
def recursive_glob(directory):
|
||||
return [os.path.join(dirpath, f)
|
||||
for dirpath, dirnames, files in os.walk(directory)
|
||||
for f in fnmatch.filter(files, '*')]
|
||||
|
||||
def find_files(directory, pattern):
|
||||
if "/" in pattern:
|
||||
return glob.glob(os.path.join(directory, pattern))
|
||||
if pattern.endswith("/"):
|
||||
return recursive_glob(os.path.join(directory, pattern))
|
||||
matches = []
|
||||
for root, dirnames, filenames in os.walk(directory):
|
||||
for filename in fnmatch.filter(filenames, pattern):
|
||||
|
|
Loading…
Reference in a new issue