pwd static method

Future<String> pwd()

Implementation

static Future<String> pwd() async {
  late final String command;
  if (Platform.isWindows) {
    command = "cd";
  } else if (Platform.isLinux) {
    command = "pwd";
  } else {
    // fixme: refactor
    // throw AppException(
    //     message: "Invalid operating system. Please implement first");
  }
  final data = await Shell().run(command).then((value) => value.outText);
  if (Platform.isWindows) {
    return pathFormatter(data);
  }
  return data;
}