This commit is contained in:
parent
37d2e06a18
commit
3bcb7e18ce
@ -34,7 +34,7 @@ class Executor:
|
||||
|
||||
def setCurrentDirectory(self, dirName: str) -> str:
|
||||
if dirName == "..":
|
||||
if self.currentDirectory == self.baseDir:
|
||||
if self.currentDirectory == "":
|
||||
return self.currentDirectory
|
||||
else:
|
||||
directories = self.currentDirectory.split(os.path.sep)
|
||||
@ -42,13 +42,13 @@ class Executor:
|
||||
for dir in directories:
|
||||
strdirectory += dir + os.path.sep
|
||||
strdirectory = strdirectory[:-3]
|
||||
if os.path.exists(strdirectory):
|
||||
if os.path.exists(os.path.join(self.baseDir, self.currentDirectory)):
|
||||
self.currentDirectory = strdirectory
|
||||
return self.currentDirectory
|
||||
else:
|
||||
dirName = self.sanitizeDirectory(dirName)
|
||||
joinedDir = os.path.join(self.baseDir, self.currentDirectory, dirName)
|
||||
if os.path.exists(joinedDir):
|
||||
joinedDir = os.path.join(self.currentDirectory, dirName)
|
||||
if os.path.join(self.baseDir, joinedDir):
|
||||
self.currentDirectory = joinedDir
|
||||
return self.currentDirectory
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user