getValidProjectPath static method

String getValidProjectPath(
  1. String subdirectory
)

Implementation

static String getValidProjectPath(String subdirectory) {
  String path = DirectoryService.choosePath();

  while (Validator.isValidPath('$path/$subdirectory') == false) {
    Console.writeLine(dcli.red(Constants.kFolderNotFound));
    path = InputService.getValidatedInput(
      consoleMessage: Constants.kEnterPath,
      errorMessage: Constants.kInvalidPath,
      functionValidator: Validator.isValidPath
    ) ?? '';
  }
  return path;
}