Skip to content

Commit

Permalink
Merge branch 'fix/local-mirror-exceptions' of https://github.com/flut…
Browse files Browse the repository at this point in the history
…tertools/fvm into fix/local-mirror-exceptions
  • Loading branch information
leoafarias committed Aug 25, 2024
2 parents d6683a7 + 0aed9d6 commit 27e84af
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 83 deletions.
3 changes: 3 additions & 0 deletions lib/src/models/flutter_version_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,7 @@ class FlutterVersion with FlutterVersionMappable {

return compareSemver(versionWeight, otherVersion);
}

@override
String toString() => name;
}
8 changes: 8 additions & 0 deletions lib/src/workflows/ensure_cache.workflow.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Future<CacheFlutterVersion> ensureCacheWorkflow(
bool force = false,
}) async {
_validateContext();
_validateGit();
// Get valid flutter version
final validVersion = await validateFlutterVersion(version, force: force);
try {
Expand Down Expand Up @@ -261,3 +262,10 @@ void _validateContext() {
);
}
}

void _validateGit() {
final isGitInstalled = Process.runSync('git', ['--version']).exitCode == 0;
if (!isGitInstalled) {
throw AppException('Git is not installed');
}
}
Loading

0 comments on commit 27e84af

Please sign in to comment.