Update Doctor command
This commit is contained in:
parent
df0632d000
commit
1cc9e0b83a
3 changed files with 7 additions and 16 deletions
|
@ -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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ import 'package:pubspec_parse/pubspec_parse.dart';
|
|||
|
||||
final String checkmark = ansiOutputEnabled ? '\u2713' : '[Success]';
|
||||
|
||||
final String ballot = ansiOutputEnabled ? '\u2717' : '[Failure]';
|
||||
|
||||
Future<Pubspec> loadPubspec() {
|
||||
var file = new File('pubspec.yaml');
|
||||
return file
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue