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

Unified Diff: gyp/find.py

Issue 1123173005: Experiment with find as a road to Gyp sanity. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: mv Created 5 years, 7 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/iOSShell.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
new file mode 100644
index 0000000000000000000000000000000000000000..a5f40db1803abd1711c0b83e14384bc5d5f5a81b
--- /dev/null
+++ b/gyp/find.py
@@ -0,0 +1,22 @@
+# Copyright 2015 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+'''
+find.py is a poor-man's emulation of `find $1 -name=$2` on Unix.
+
+Call python find.py <directory> <glob> to list all files matching glob under
+directory (recursively). E.g.
+ $ python find.py ../tests/ '*.cpp'
+will print all .cpp files under ../tests/.
+'''
+
+import fnmatch
+import os
+import sys
+
+for d, kids, files in os.walk(sys.argv[1]):
+ for f in files:
+ if fnmatch.fnmatch(f, sys.argv[2]):
+ print os.path.join(d, f).replace('\\', '/') # Gyp wants Unix paths.
« no previous file with comments | « gyp/bench.gypi ('k') | gyp/iOSShell.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698