FutureOr isExecutable()

in lib/src/permissions.dart [57:69]


FutureOr<bool> isExecutable(
  String path, {
  bool? isWindows,
  FutureOr<FileStat> Function(String path) getStat = FileStat.stat,
}) {
  // Windows has no concept of executable.
  if (isWindows ?? Platform.isWindows) return true;
  final stat = getStat(path);
  if (stat is FileStat) {
    return _isExecutable(stat);
  }
  return stat.then(_isExecutable);
}