getDestinationDirectory method

dynamic getDestinationDirectory()

Implementation

getDestinationDirectory() async {
  if (_destinationDirectoryPath.isNotEmpty) return;
  print('\n');
  ColoredLog.magenta(
    'Enter Destination Directory where module will be created',
    name: 'Instruction',
  );
  ColoredLog.magenta(
    'Directory Path :  "User/username/Projects/flutter/auth"',
    name: 'Eg',
  );
  print('\n');
  ColoredLog.white('Enter Directory path:', name: 'Input');
  final input = stdin.readLineSync();
  if ((input ?? '').isNotEmpty) {
    String path = input!.replaceAll('\'', '');
    path = path.replaceAll('"', '');
    _destinationDirectoryPath = path;
  } else {
    ColoredLog.red(
      'invalid input',
      name: 'Error',
      style: LogStyle.blinkSlow,
    );
    exit(0);
  }
  ColoredLog.green(
    _destinationDirectoryPath,
    name: 'Destination Directory Path',
  );
  print('\n');
}