changeDirectory method

void changeDirectory(
  1. String path
)

Changes the current working directory to the specified path.

Implementation

void changeDirectory(String path) {
  final fullPath = resolvePath(path);
  if (Directory(fullPath).existsSync()) {
    currentDirectory = fullPath;
  } else {
    throw FileSystemException("Directory not found", fullPath);
  }
}