isDirectoryChangingCommand function

bool isDirectoryChangingCommand(
  1. String command
)

Check if a command modifies the working directory.

Implementation

bool isDirectoryChangingCommand(String command) {
  final exe = extractExecutable(command);
  if (exe == null) return false;
  return exe == 'cd' || exe == 'pushd' || exe == 'popd';
}