Skip to content

Commit

Permalink
Merge pull request #1 from Infosys/feature-flutter
Browse files Browse the repository at this point in the history
Feature flutter
  • Loading branch information
GSPrakashNaidu2662 authored Nov 9, 2023
2 parents 644d2bd + 20faf84 commit 67b2d9a
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions lib/provider/global_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,23 @@ class GlobalProvider with ChangeNotifier {
if(versionNoAppTemp == "") {
versionNoAppTemp = await networkService.getVersionFromGobalParam("mosip.registration.server_version");
}
final head = await rootBundle.loadString('.git/HEAD');
final commitId = await rootBundle.loadString('.git/ORIG_HEAD');

final branch = head.split('/').last;
String head = "";
String branchName = "";
String commitId = "";
try {
head = await rootBundle.loadString('.git/HEAD');
branchName = head.split('/').last;
if (head.startsWith('ref: ')) {
branchName = head.split('ref: refs/heads/').last.trim();
commitId = await rootBundle.loadString('.git/refs/heads/$branchName');
} else {
commitId = head;
}
} catch(e) {
debugPrint("Failed fetching git info: $e");
}

branchNameApp = branch;
branchNameApp = branchName;
commitIdApp = commitId;
versionNoApp = versionNoAppTemp;
}
Expand Down

0 comments on commit 67b2d9a

Please sign in to comment.