| OLD | NEW |
| 1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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 import 'dart:io'; | 5 import 'dart:io'; |
| 6 | 6 |
| 7 import 'package:servicec/compiler.dart' as servicec; | 7 import 'package:servicec/compiler.dart' as servicec; |
| 8 import 'package:args/args.dart'; | 8 import 'package:args/args.dart'; |
| 9 | 9 |
| 10 main(List<String> arguments) { | 10 main(List<String> arguments) { |
| 11 ArgParser parser = new ArgParser(); | 11 ArgParser parser = new ArgParser(); |
| 12 parser.addOption('out', defaultsTo: "."); | 12 parser.addOption('out', defaultsTo: "."); |
| 13 ArgResults results = parser.parse(arguments); | 13 ArgResults results = parser.parse(arguments); |
| 14 String outputDirectory = results['out']; | 14 String outputDirectory = results['out']; |
| 15 if (!(new Directory(outputDirectory)).existsSync()) { | 15 if (!(new Directory(outputDirectory)).existsSync()) { |
| 16 print("Output directory '$outputDirectory' does not exist."); | 16 print("Output directory '$outputDirectory' does not exist."); |
| 17 exit(1); | 17 exit(1); |
| 18 } | 18 } |
| 19 if (results.rest.isEmpty) { | 19 if (results.rest.isEmpty) { |
| 20 print("No input files."); | 20 print("No input files."); |
| 21 exit(1); | 21 exit(1); |
| 22 } | 22 } |
| 23 for (String path in results.rest) { | 23 for (String path in results.rest) { |
| 24 servicec.compile(path, outputDirectory); | 24 servicec.compile(path, outputDirectory); |
| 25 } | 25 } |
| 26 } | 26 } |
| OLD | NEW |