fix cd bug

This commit is contained in:
AlessandroZ 2017-01-31 10:45:43 +01:00
parent f3fc9a5fca
commit dc40950eb1
1 changed files with 5 additions and 2 deletions

View File

@ -79,8 +79,11 @@ def ls(path=None):
def cd(path=None):
if not path:
home = os.path.expanduser("~")
os.chdir(home)
return
try:
os.chdir(home)
return
except:
return "[-] Home directory not found (or access denied): %s" % home
path = os.path.join(os.getcwd(), path)
if os.path.isdir(path):