updateCwd method

String? updateCwd(
  1. String newCwd
)

Update CWD from command output.

Implementation

String? updateCwd(String newCwd) {
  if (_maintainProjectDir && !_isUnderProject(newCwd)) {
    final reason =
        'Shell cwd was reset to $_projectRoot '
        '(was: $newCwd, outside project)';
    _cwd = _projectRoot;
    return reason;
  }

  _cwd = newCwd;
  return null;
}