Skip to content

Commit

Permalink
Removed pub_semver dep
Browse files Browse the repository at this point in the history
  • Loading branch information
leoafarias committed Apr 23, 2021
1 parent 2f8483e commit cbb43b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/fvm.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export 'package:fvm/src/models/cache_version_model.dart';
export 'package:fvm/src/models/config_model.dart';
export 'package:fvm/src/models/project_model.dart';
export 'package:fvm/src/models/settings_model.dart';
export 'package:fvm/src/models/settings_model.dart';
export 'package:fvm/src/services/releases_service/models/channels.model.dart';
export 'package:fvm/src/services/releases_service/models/flutter_releases.model.dart';
export 'package:fvm/src/services/releases_service/models/release.model.dart';
Expand Down
8 changes: 3 additions & 5 deletions lib/src/utils/pubdev.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'dart:convert';

import 'package:io/ansi.dart';
import 'package:pub_semver/pub_semver.dart';

import '../version.dart';
import 'helpers.dart';
import 'http.dart';

const _packageUrl = 'https://pub.dev/api/packages/fvm';
Expand All @@ -23,12 +23,10 @@ Future<bool> checkIfLatestVersion({String? currentVersion}) async {
try {
final latestVersion = await _fetchLatestVersion();

final latestSemVer = Version.parse(latestVersion);
var needUpdate = false;
final comparison = compareSemver(currentVersion, latestVersion);

final current = Version.parse(currentVersion);
// Check as need update if latest version is higher
needUpdate = latestSemVer > current;
final needUpdate = comparison < 0;

if (needUpdate) {
final updateCmd = cyan.wrap('pub global activate fvm');
Expand Down

0 comments on commit cbb43b9

Please sign in to comment.