From 1cc9e0b83a6aa16f9dd8acc9945768c35a66fd32 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Sat, 14 Jul 2018 18:16:14 -0400 Subject: [PATCH] Update Doctor command --- lib/src/commands/doctor.dart | 14 +++++--------- lib/src/util.dart | 2 ++ pubspec.yaml | 7 ------- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/lib/src/commands/doctor.dart b/lib/src/commands/doctor.dart index 836ab723..ab45e515 100644 --- a/lib/src/commands/doctor.dart +++ b/lib/src/commands/doctor.dart @@ -1,10 +1,10 @@ import "dart:convert"; import "dart:io"; import "package:args/command_runner.dart"; -import "package:console/console.dart"; +import 'package:io/ansi.dart'; +import '../util.dart'; class DoctorCommand extends Command { - final TextPen _pen = new TextPen(); @override String get name => "doctor"; @@ -23,16 +23,12 @@ class DoctorCommand extends Command { try { var git = await Process.start("git", ["--version"]); if (await git.exitCode == 0) { - var version = await git.stdout.transform(UTF8.decoder).join(); - _pen.green(); - _pen("${Icon.CHECKMARK} Git executable found: v${version.replaceAll('git version', '').trim()}"); - _pen(); + var version = await git.stdout.transform(utf8.decoder).join(); + print(green.wrap("$checkmark Git executable found: v${version.replaceAll('git version', '').trim()}")) } else throw new Exception("Git executable exit code not 0"); } catch (exc) { - _pen.red(); - _pen("${Icon.BALLOT_X} Git executable not found"); - _pen(); + print(red.wrap("$ballot Git executable not found")); } } } diff --git a/lib/src/util.dart b/lib/src/util.dart index 8ca561c7..588e3ad3 100644 --- a/lib/src/util.dart +++ b/lib/src/util.dart @@ -6,6 +6,8 @@ import 'package:pubspec_parse/pubspec_parse.dart'; final String checkmark = ansiOutputEnabled ? '\u2713' : '[Success]'; +final String ballot = ansiOutputEnabled ? '\u2717' : '[Failure]'; + Future loadPubspec() { var file = new File('pubspec.yaml'); return file diff --git a/pubspec.yaml b/pubspec.yaml index 27327240..6d62c7e5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,8 +7,6 @@ dependencies: # analyzer: ^0.29.0 args: ^1.0.0 code_builder: ^3.0.0 - #console: ^2.2.3 - dart2_constant: ^1.0.0 dart_style: ^1.0.0 glob: ^1.1.0 homedir: ^0.0.4 @@ -16,7 +14,6 @@ dependencies: id: ^1.0.0 io: ^0.3.2 inflection: ^0.4.1 - #mustache4dart: ^2.1.0 path: ^1.0.0 prompts: ^1.0.0 pubspec_parse: ^0.1.2 @@ -25,10 +22,6 @@ dependencies: watcher: ^0.9.7 yaml: ^2.0.0 #yamlicious: ^0.0.5 -dev_dependencies: - #build: ^0.7.0 - #build_runner: ^0.3.0 - #check_for_update: ^1.0.0 environment: sdk: ">=2.0.0-dev <3.0.0" executables: