Skip to content

Commit 0fa700b

Browse files
authored
Merge pull request #14 from tmthecoder/fix-dart-run-failure
Fix the failed `dart run` command
2 parents b735d4e + 2808cfc commit 0fa700b

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

dargon2/lib/src/native/dart_lib_loader.dart

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,11 @@ class DartLibLoader implements LibLoader {
2929
/// and the binary's relative path
3030
@override
3131
String getPath() {
32-
String rootPath;
33-
if (Platform.script.path.endsWith('.snapshot')) {
34-
rootPath = File.fromUri(Platform.script).parent.path;
35-
} else {
36-
final rootLibrary = 'package:dargon2/dargon2.dart';
37-
// ignore: deprecated_member_use
38-
rootPath = waitFor(Isolate.resolvePackageUri(Uri.parse(rootLibrary)))!
32+
final rootLibrary = 'package:dargon2/dargon2.dart';
33+
// ignore: deprecated_member_use
34+
var rootPath = waitFor(Isolate.resolvePackageUri(Uri.parse(rootLibrary)))!
3935
.resolve('src/blobs/')
4036
.toFilePath(windows: Platform.isWindows);
41-
}
4237
if (Platform.isMacOS) return '${rootPath}libargon2-darwin.dylib';
4338
if (Platform.isLinux) return '${rootPath}libargon2-linux.so';
4439
if (Platform.isWindows) return '${rootPath}libargon2-win.dll';

0 commit comments

Comments
 (0)