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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « gyp/bench.gypi ('k') | gyp/fuzz.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 Google Inc. 1 # Copyright 2015 Google Inc.
2 # 2 #
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 ''' 6 '''
7 find.py is a poor-man's emulation of `find $1 -name=$2` on Unix. 7 find.py is a poor-man's emulation of `find -name=$1 $2` on Unix.
8 8
9 Call python find.py <directory> <glob> to list all files matching glob under 9 Call python find.py <glob> <directory>... to list all files matching glob under
10 directory (recursively). E.g. 10 directory (recursively). E.g.
11 $ python find.py ../tests/ '*.cpp' 11 $ python find.py '*.cpp' ../tests/ ../bench/
12 will print all .cpp files under ../tests/. 12 will print all .cpp files under ../tests/ and ../bench/.
13 ''' 13 '''
14 14
15 import fnmatch 15 import fnmatch
16 import os 16 import os
17 import sys 17 import sys
18 18
19 for d, kids, files in os.walk(sys.argv[1]): 19 for directory in sys.argv[2:]:
20 files.sort() 20 for d, kids, files in os.walk(directory):
21 for f in files: 21 files.sort()
22 if fnmatch.fnmatch(f, sys.argv[2]): 22 for f in files:
23 print os.path.join(d, f).replace('\\', '/') # Gyp wants Unix paths. 23 if fnmatch.fnmatch(f, sys.argv[1]):
24 print os.path.join(d, f).replace('\\', '/') # Gyp wants Unix paths.
OLDNEW
« 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