Validate the @foo resources in material_en.arb (#12824)

This commit is contained in:
Hans Muller
2017-11-01 16:14:10 -07:00
committed by GitHub
parent e023e89b8e
commit 5c1320e5b9
4 changed files with 73 additions and 18 deletions

View File

@@ -7,8 +7,10 @@ import 'dart:io';
import 'package:args/args.dart' as argslib;
import 'package:meta/meta.dart';
void fatal(String message) {
stderr.writeln(message);
void exitWithError(String errorMessage) {
if (errorMessage == null)
return;
stderr.writeln('Fatal Error: $errorMessage');
exit(1);
}
@@ -16,7 +18,7 @@ void checkCwdIsRepoRoot(String commandName) {
final bool isRepoRoot = new Directory('.git').existsSync();
if (!isRepoRoot) {
fatal(
exitWithError(
'$commandName must be run from the root of the Flutter repository. The '
'current working directory is: ${Directory.current.path}'
);
@@ -32,7 +34,7 @@ GeneratorOptions parseArgs(List<String> rawArgs) {
);
final argslib.ArgResults args = argParser.parse(rawArgs);
final bool writeToFile = args['overwrite'];
return new GeneratorOptions(writeToFile: writeToFile);
}