getAppName method
Fetches the app name from the Linux CMakeLists.txt file.
Returns: Future<String?>, the app name if found, null otherwise.
Implementation
@override
Future<String?> getAppName() async {
final filePath = linuxCMakeListsPath;
var contentLineByLine = await readFileAsLineByline(
filePath: filePath,
);
for (var i = 0; i < contentLineByLine.length; i++) {
if (contentLineByLine[i]?.contains('set(BINARY_NAME') ?? false) {
var match = RegExp(r'set\(BINARY_NAME "(.*?)"\)')
.firstMatch(contentLineByLine[i]!);
return match?.group(1)?.trim();
}
}
return null;
}