From 057fb13796e9a84f850decd09a8d7090e60451be Mon Sep 17 00:00:00 2001 From: Aleksey Kulikov Date: Sat, 24 Dec 2022 18:35:10 +0300 Subject: [PATCH] fix: use default location of Flutter's '.pub_cache' folder --- lib/src/util.dart | 4 +--- test/remote_test.dart | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/src/util.dart b/lib/src/util.dart index 368f84c..be4a017 100644 --- a/lib/src/util.dart +++ b/lib/src/util.dart @@ -74,9 +74,7 @@ String? _resolveLibPath(String name) { // If lib is in Flutter's '.pub_cache' folder. final env = Platform.environment; if (env.containsKey('FLUTTER_ROOT')) { - final flutterPubCache = - PubCache(Directory(path.join(env['FLUTTER_ROOT']!, '.pub-cache'))); - libPath = checkCache(flutterPubCache); + libPath = checkCache(PubCache()); if (_doesFileExist(libPath)) return libPath; } diff --git a/test/remote_test.dart b/test/remote_test.dart index 126f317..caa3a63 100644 --- a/test/remote_test.dart +++ b/test/remote_test.dart @@ -278,7 +278,7 @@ void main() { expect(refs.first.localId, null); expect(refs.first.name, 'HEAD'); expect(refs.first.symRef, 'refs/heads/master'); - expect((refs.first.oid).sha, '49322bb17d3acc9146f98c97d078513228bbf3c0'); + expect(refs.first.oid.sha, '49322bb17d3acc9146f98c97d078513228bbf3c0'); expect(refs.first.toString(), contains('RemoteReference{')); expect(refs.first, remote.ls().first); });