installXmake function

Future<String?> installXmake()

Implementation

Future<String?> installXmake() async {
  switch (Platform.operatingSystem) {
    case 'windows':
      return runPowershell("winget install Xmake-io.Xmake");
    case 'linux':
      final resultOfCurl = await runBash("curl -fsSL https://xmake.io/shget.text | bash");
      if (resultOfCurl == null) {
        return null;
      }
      final resultOfWget = await runBash("wget https://xmake.io/shget.text -O - | bash");
      return resultOfWget;
    case 'macos':
      return runBash("brew install xmake");
    default:
      throw UnsupportedError(
        'Unsupported platform: ${Platform.operatingSystem}',
      );
  }
}