| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * **Note**: If you already have a `build.dart` in your application, we | 6 * **Note**: If you already have a `build.dart` in your application, we |
| 7 * recommend to use the `package:polymer/builder.dart` library instead. | 7 * recommend to use the `package:polymer/builder.dart` library instead. |
| 8 | 8 |
| 9 * Temporary deploy command used to create a version of the app that can be | 9 * Temporary deploy command used to create a version of the app that can be |
| 10 * compiled with dart2js and deployed. Following pub layout conventions, this | 10 * compiled with dart2js and deployed. Following pub layout conventions, this |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 String _findDirWithFile(String dir, String filename) { | 87 String _findDirWithFile(String dir, String filename) { |
| 88 while (!new File(path.join(dir, filename)).existsSync()) { | 88 while (!new File(path.join(dir, filename)).existsSync()) { |
| 89 var parentDir = path.dirname(dir); | 89 var parentDir = path.dirname(dir); |
| 90 // If we reached root and failed to find it, bail. | 90 // If we reached root and failed to find it, bail. |
| 91 if (parentDir == dir) return null; | 91 if (parentDir == dir) return null; |
| 92 dir = parentDir; | 92 dir = parentDir; |
| 93 } | 93 } |
| 94 return dir; | 94 return dir; |
| 95 } | 95 } |
| 96 | 96 |
| 97 void _reportErrorAndExit(e) { | 97 void _reportErrorAndExit(e, trace) { |
| 98 var trace = getAttachedStackTrace(e); | |
| 99 print('Uncaught error: $e'); | 98 print('Uncaught error: $e'); |
| 100 if (trace != null) print(trace); | 99 if (trace != null) print(trace); |
| 101 exit(1); | 100 exit(1); |
| 102 } | 101 } |
| 103 | 102 |
| 104 ArgResults _parseArgs(arguments) { | 103 ArgResults _parseArgs(arguments) { |
| 105 var parser = new ArgParser() | 104 var parser = new ArgParser() |
| 106 ..addFlag('help', abbr: 'h', help: 'Displays this help message.', | 105 ..addFlag('help', abbr: 'h', help: 'Displays this help message.', |
| 107 defaultsTo: false, negatable: false) | 106 defaultsTo: false, negatable: false) |
| 108 ..addOption('out', abbr: 'o', help: 'Directory to generate files into.', | 107 ..addOption('out', abbr: 'o', help: 'Directory to generate files into.', |
| (...skipping 20 matching lines...) Expand all Loading... |
| 129 _showUsage(parser); | 128 _showUsage(parser); |
| 130 return null; | 129 return null; |
| 131 } | 130 } |
| 132 } | 131 } |
| 133 | 132 |
| 134 _showUsage(parser) { | 133 _showUsage(parser) { |
| 135 print('Usage: dart --package-root=packages/ ' | 134 print('Usage: dart --package-root=packages/ ' |
| 136 'package:polymer/deploy.dart [options]'); | 135 'package:polymer/deploy.dart [options]'); |
| 137 print(parser.getUsage()); | 136 print(parser.getUsage()); |
| 138 } | 137 } |
| OLD | NEW |