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

Unified Diff: sdk/lib/_internal/pub/lib/src/git.dart

Issue 308793016: Ensure that a friendly error is printed whenever git can't be found. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/source/git.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/git.dart
diff --git a/sdk/lib/_internal/pub/lib/src/git.dart b/sdk/lib/_internal/pub/lib/src/git.dart
index 510ca7eecd3819dea05246c6beea8e2e6edebfab..d79a914073e6d2c818b39718d9ae7350f96854c6 100644
--- a/sdk/lib/_internal/pub/lib/src/git.dart
+++ b/sdk/lib/_internal/pub/lib/src/git.dart
@@ -10,6 +10,7 @@ import 'dart:io';
import 'io.dart';
import 'log.dart' as log;
+import 'utils.dart';
/// An exception thrown because a git command failed.
class GitException implements Exception {
@@ -41,6 +42,12 @@ Future<bool> get isInstalled {
Future<List<String>> run(List<String> args,
{String workingDir, Map<String, String> environment}) {
return _gitCommand.then((git) {
+ if (git == null) {
+ throw new ApplicationException(
+ "Cannot find a Git executable.\n"
+ "Please ensure Git is correctly installed.");
+ }
+
return runProcess(git, args, workingDir: workingDir,
environment: environment);
}).then((result) {
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/source/git.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698