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

Side by Side Diff: tools/yaml2json.dart

Issue 2827793002: Format all files under tools and utils directory. (Closed)
Patch Set: Format all files under tools and utils directory. Created 3 years, 8 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 import 'dart:io' show File, exit, stderr; 5 import 'dart:io' show File, exit, stderr;
6 6
7 import 'dart:isolate' show RawReceivePort; 7 import 'dart:isolate' show RawReceivePort;
8 8
9 import 'dart:convert' show JsonEncoder; 9 import 'dart:convert' show JsonEncoder;
10 10
11 import 'package:yaml/yaml.dart' show loadYaml; 11 import 'package:yaml/yaml.dart' show loadYaml;
12 12
13 main(List<String> arguments) async { 13 main(List<String> arguments) async {
14 var port = new RawReceivePort(); 14 var port = new RawReceivePort();
15 if (arguments.length != 2) { 15 if (arguments.length != 2) {
16 stderr.writeln("Usage: yaml2json.dart input.yaml output.json"); 16 stderr.writeln("Usage: yaml2json.dart input.yaml output.json");
17 exit(1); 17 exit(1);
18 } 18 }
19 Uri input = Uri.base.resolve(arguments[0]); 19 Uri input = Uri.base.resolve(arguments[0]);
20 Uri output = Uri.base.resolve(arguments[1]); 20 Uri output = Uri.base.resolve(arguments[1]);
21 var yaml = loadYaml(await new File.fromUri(input).readAsString()); 21 var yaml = loadYaml(await new File.fromUri(input).readAsString());
22 await new File.fromUri(output).writeAsString( 22 await new File.fromUri(output)
23 const JsonEncoder.withIndent(" ").convert(yaml)); 23 .writeAsString(const JsonEncoder.withIndent(" ").convert(yaml));
24 port.close(); 24 port.close();
25 } 25 }
OLDNEW
« no previous file with comments | « tools/testing/dart/vendored_pkg/args/src/parser.dart ('k') | utils/compiler/create_snapshot.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698