Merge branch 'cd_error' of https://github.com/adqm/xonsh into cd_error

This commit is contained in:
adam j hartz 2015-12-04 11:19:15 -05:00
commit 6677da9af7

View file

@ -88,6 +88,8 @@ def cd(args, stdin=None):
return '', 'cd: no such file or directory: {0}\n'.format(d)
if not os.path.isdir(d):
return '', 'cd: {0} is not a directory\n'.format(d)
if not os.access(d, os.X_OK):
return '', 'cd: permission denied: {0}\n'.format(d)
# now, push the directory onto the dirstack if AUTO_PUSHD is set
if cwd is not None and env.get('AUTO_PUSHD'):
pushd(['-n', '-q', cwd])