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

Side by Side Diff: build/util/remove_tree.py

Issue 23301019: Remove third_party/cld2 once (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 7 years, 3 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
« DEPS ('K') | « DEPS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """
7 remove_tree.py -- Remove the specified directory recursively
8 """
9
10 import os
11 import shutil
12 import sys
13
14 def main(argv=None):
Isaac (away) 2013/08/28 06:22:56 make option required
hajimehoshi 2013/08/28 06:47:15 Done.
15 if argv is None:
16 argv = sys.argv
Isaac (away) 2013/08/28 06:22:56 remove these lines
hajimehoshi 2013/08/28 06:47:15 Done.
17
18 if len(argv) != 2:
Isaac (away) 2013/08/28 06:22:56 return 'Usage: %s <PATH>' % os.path.basename(__fil
Isaac (away) 2013/08/28 06:24:18 Actually you should use: return 'Usage: %s <PATH>
hajimehoshi 2013/08/28 06:47:15 Done.
19 program = os.path.basename(__file__)
20 sys.stderr.write('Usage: ' + program + ' PATH\n')
21 sys.exit(1)
Isaac (away) 2013/08/28 06:22:56 remove these lines
hajimehoshi 2013/08/28 06:47:15 Done.
22
23 path = argv[1]
24 shutil.rmtree(path, True)
25
26 return 0
Isaac (away) 2013/08/28 06:22:56 Not needed, sys.exit(None) exits with zero, remove
hajimehoshi 2013/08/28 06:47:15 Done.
27
28 if __name__ == '__main__':
29 sys.exit(main())
Isaac (away) 2013/08/28 06:22:56 pass sys.argv here
hajimehoshi 2013/08/28 06:47:15 Done.
OLDNEW
« DEPS ('K') | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698