bestForAppImage method

Future<String> bestForAppImage({
  1. String to = 'install',
})

Determines the best installation method for package managers that work on any operating system.

The to parameter is the installation target.

Implementation

Future<String> bestForAppImage({String to = 'install'}) async {
  // @TODO: Research if there is something to do here.

  final methods = package.methods ?? [];
  final hasMethod = methods.contains('appimage');

  if (hasMethod) {
    final String bestAppImage = 'echo "AppImage has no executable"';

    return '${to}_appimage "$bestAppImage"';
  }

  stopIfForcedMethodNotFound();

  return await bestForAny(to: to);
}