| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2015 The Chromium Authors. All rights reserved. | 3 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """Utility for dart_pkg and dart_pkg_app rules""" | 7 """Utility for dart_pkg and dart_pkg_app rules""" |
| 8 | 8 |
| 9 import argparse | 9 import argparse |
| 10 import errno | 10 import errno |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 | 42 |
| 43 def mojom_filter(path): | 43 def mojom_filter(path): |
| 44 if os.path.isdir(path): | 44 if os.path.isdir(path): |
| 45 return True | 45 return True |
| 46 _, ext = os.path.splitext(path) | 46 _, ext = os.path.splitext(path) |
| 47 return ext == '.mojom' | 47 return ext == '.mojom' |
| 48 | 48 |
| 49 | 49 |
| 50 def ensure_dir_exists(path): | 50 def ensure_dir_exists(path): |
| 51 if not os.path.exists(path): | 51 abspath = os.path.abspath(path) |
| 52 os.makedirs(path) | 52 if not os.path.exists(abspath): |
| 53 os.makedirs(abspath) |
| 53 | 54 |
| 54 | 55 |
| 55 def has_pubspec_yaml(paths): | 56 def has_pubspec_yaml(paths): |
| 56 for path in paths: | 57 for path in paths: |
| 57 _, filename = os.path.split(path) | 58 _, filename = os.path.split(path) |
| 58 if 'pubspec.yaml' == filename: | 59 if 'pubspec.yaml' == filename: |
| 59 return True | 60 return True |
| 60 return False | 61 return False |
| 61 | 62 |
| 62 | 63 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 # Remove any broken symlinks in target_dir and package root. | 267 # Remove any broken symlinks in target_dir and package root. |
| 267 remove_broken_symlinks(target_dir) | 268 remove_broken_symlinks(target_dir) |
| 268 remove_broken_symlinks(args.package_root) | 269 remove_broken_symlinks(args.package_root) |
| 269 | 270 |
| 270 # Write stamp file. | 271 # Write stamp file. |
| 271 with open(args.stamp_file, 'w'): | 272 with open(args.stamp_file, 'w'): |
| 272 pass | 273 pass |
| 273 | 274 |
| 274 if __name__ == '__main__': | 275 if __name__ == '__main__': |
| 275 sys.exit(main()) | 276 sys.exit(main()) |
| OLD | NEW |