| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
| 6 # | 6 # |
| 7 | 7 |
| 8 import os |
| 8 import shutil | 9 import shutil |
| 9 import sys | 10 import sys |
| 10 import subprocess | 11 import subprocess |
| 11 import utils | 12 import utils |
| 12 | 13 |
| 13 def Main(): | 14 def Main(): |
| 14 build_root = utils.GetBuildRoot(utils.GuessOS()) | 15 build_root = utils.GetBuildRoot(utils.GuessOS()) |
| 15 print 'Deleting %s' % build_root | 16 print 'Deleting %s' % build_root |
| 16 if sys.platform != 'win32': | 17 if sys.platform != 'win32': |
| 17 shutil.rmtree(build_root, ignore_errors=True) | 18 shutil.rmtree(build_root, ignore_errors=True) |
| 18 else: | 19 else: |
| 19 # Intentionally ignore return value since a directory might be in use. | 20 # Intentionally ignore return value since a directory might be in use. |
| 20 subprocess.call(['rmdir', '/Q', '/S', build_root], | 21 subprocess.call(['rmdir', '/Q', '/S', build_root], |
| 21 env=os.environ.copy(), | 22 env=os.environ.copy(), |
| 22 shell=True) | 23 shell=True) |
| 23 return 0 | 24 return 0 |
| 24 | 25 |
| 25 if __name__ == '__main__': | 26 if __name__ == '__main__': |
| 26 sys.exit(Main()) | 27 sys.exit(Main()) |
| OLD | NEW |