Remove problematic Map casts
This commit is contained in:
parent
96b9668ad5
commit
dca32896eb
2 changed files with 11 additions and 4 deletions
|
@ -11,6 +11,9 @@ main(List<String> args) async {
|
|||
var runner =
|
||||
new CommandRunner("angel", "Command-line tools for the Angel framework.");
|
||||
|
||||
runner.argParser
|
||||
.addFlag('verbose', help: 'Print verbose output', negatable: false);
|
||||
|
||||
runner
|
||||
..addCommand(new DoctorCommand())
|
||||
..addCommand(new KeyCommand())
|
||||
|
@ -19,12 +22,16 @@ main(List<String> args) async {
|
|||
..addCommand(new RenameCommand())
|
||||
..addCommand(new MakeCommand());
|
||||
|
||||
return await runner.run(args).then((_) {}).catchError((exc) {
|
||||
return await runner.run(args).then((_) {}).catchError((exc, st) {
|
||||
if (exc is String) {
|
||||
stdout.writeln(exc);
|
||||
} else {
|
||||
stderr.writeln("Oops, something went wrong: $exc");
|
||||
exitCode = 1;
|
||||
|
||||
if (args.contains('--verbose')) {
|
||||
stderr.writeln(st);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ class InstallCommand extends Command {
|
|||
throw 'No add-on named "$packageName" is installed. You might need to run `angel install --update`.';
|
||||
print('Installing $packageName...');
|
||||
|
||||
Map<String, dynamic> values = {
|
||||
Map values = {
|
||||
'project_name': pubspec.name,
|
||||
'pubspec': pubspec,
|
||||
};
|
||||
|
@ -106,7 +106,7 @@ class InstallCommand extends Command {
|
|||
if (await promptFile.exists()) {
|
||||
var contents = await promptFile.readAsString();
|
||||
var y = yaml.loadYamlDocument(contents);
|
||||
var cfg = y.contents.value as Map<String, dynamic>;
|
||||
var cfg = y.contents.value as Map;
|
||||
|
||||
// Loads globs
|
||||
if (cfg['templates'] is List) {
|
||||
|
@ -115,7 +115,7 @@ class InstallCommand extends Command {
|
|||
}
|
||||
|
||||
if (cfg['values'] is Map) {
|
||||
var val = cfg['values'] as Map<String, dynamic>;
|
||||
var val = cfg['values'] as Map;
|
||||
|
||||
for (var key in val.keys) {
|
||||
var desc = val[key]['description'] ?? key;
|
||||
|
|
Loading…
Reference in a new issue