mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-06 09:20:57 +01:00
Merge branch 'cd_error' of https://github.com/adqm/xonsh into cd_error
This commit is contained in:
commit
6677da9af7
1 changed files with 2 additions and 0 deletions
|
@ -88,6 +88,8 @@ def cd(args, stdin=None):
|
||||||
return '', 'cd: no such file or directory: {0}\n'.format(d)
|
return '', 'cd: no such file or directory: {0}\n'.format(d)
|
||||||
if not os.path.isdir(d):
|
if not os.path.isdir(d):
|
||||||
return '', 'cd: {0} is not a directory\n'.format(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
|
# now, push the directory onto the dirstack if AUTO_PUSHD is set
|
||||||
if cwd is not None and env.get('AUTO_PUSHD'):
|
if cwd is not None and env.get('AUTO_PUSHD'):
|
||||||
pushd(['-n', '-q', cwd])
|
pushd(['-n', '-q', cwd])
|
||||||
|
|
Loading…
Add table
Reference in a new issue