popd method

  1. @override
Shell popd()

Pop the current directory to get the previous shell throw State error if nothing in the stack

Implementation

@override
Shell popd() {
  if (_parentShell == null) {
    throw StateError('no previous shell');
  }
  if (_options.commandVerbose) {
    streamSinkWriteln(
      _options.stdout ?? stdout,
      '\$ cd ${_parentShell!._workingDirectoryPath}',
      encoding: _options.stdoutEncoding,
    );
  }
  return _parentShell!;
}