Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Unified Diff: gyp/find.py

Issue 2205903004: GN: get echo-headers sources via exec_script (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: still needed for Mac Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/bench.gypi ('k') | gyp/fuzz.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gyp/find.py
diff --git a/gyp/find.py b/gyp/find.py
index 247a576228054605aa457dca8fbcfffab3c9f24d..d784dc26b3a59a307cbc96b1b72035e3f3875dc8 100644
--- a/gyp/find.py
+++ b/gyp/find.py
@@ -4,20 +4,21 @@
# found in the LICENSE file.
'''
-find.py is a poor-man's emulation of `find $1 -name=$2` on Unix.
+find.py is a poor-man's emulation of `find -name=$1 $2` on Unix.
-Call python find.py <directory> <glob> to list all files matching glob under
+Call python find.py <glob> <directory>... to list all files matching glob under
directory (recursively). E.g.
- $ python find.py ../tests/ '*.cpp'
-will print all .cpp files under ../tests/.
+ $ python find.py '*.cpp' ../tests/ ../bench/
+will print all .cpp files under ../tests/ and ../bench/.
'''
import fnmatch
import os
import sys
-for d, kids, files in os.walk(sys.argv[1]):
- files.sort()
- for f in files:
- if fnmatch.fnmatch(f, sys.argv[2]):
- print os.path.join(d, f).replace('\\', '/') # Gyp wants Unix paths.
+for directory in sys.argv[2:]:
+ for d, kids, files in os.walk(directory):
+ files.sort()
+ for f in files:
+ if fnmatch.fnmatch(f, sys.argv[1]):
+ print os.path.join(d, f).replace('\\', '/') # Gyp wants Unix paths.
« no previous file with comments | « gyp/bench.gypi ('k') | gyp/fuzz.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698