Future
determineToolVersion()
Source
Future determineToolVersion() async {
try {
var toolLibraryFilePath = (await Isolate.resolvePackageUri(currentMirrorSystem().findLibrary(#aqueduct).uri))
.toFilePath(windows: Platform.isWindows);
var aqueductDirectory = new Directory(FileSystemEntity.parentOf(FileSystemEntity.parentOf(toolLibraryFilePath)));
var toolPubspecFile = new File.fromUri(aqueductDirectory.absolute.uri.resolve("pubspec.yaml"));
Map<String, dynamic> toolPubspecContents = loadYaml(toolPubspecFile.readAsStringSync());
String toolVersion = toolPubspecContents["version"];
_toolVersion = new Version.parse(toolVersion);
} catch (e) {
print(e);
}
}