mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
Fix recursive globbing in tools/format.py
And use third_party/depot_tools/gn.
This commit is contained in:
parent
1de16af1f3
commit
7baf8a0fd1
2 changed files with 27 additions and 12 deletions
|
@ -55,3 +55,16 @@ def touch(fname):
|
|||
os.utime(fname, None)
|
||||
else:
|
||||
open(fname, 'a').close()
|
||||
|
||||
|
||||
# Recursive search for files of certain extensions.
|
||||
# (Recursive glob doesn't exist in python 2.7.)
|
||||
def find_exts(directory, *extensions):
|
||||
matches = []
|
||||
for root, dirnames, filenames in os.walk(directory):
|
||||
for filename in filenames:
|
||||
for ext in extensions:
|
||||
if filename.endswith(ext):
|
||||
matches.append(os.path.join(root, filename))
|
||||
break
|
||||
return matches
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue