finito execturo for real
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2021-04-18 15:54:13 +02:00
parent b8828d52b4
commit 89b7b68dfe
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -36,7 +36,18 @@ class Executor:
return self.currentDirectory return self.currentDirectory
def setCurrentDirectory(self, dirName: str) -> str: def setCurrentDirectory(self, dirName: str) -> str:
# TODO : Navigate up a directory structure if dirName == "..":
if self.currentDirectory == self.baseDir:
return self.currentDirectory
else:
directories = self.currentDirectory.split("/")
strdirectory = ""
for dir in directories:
strdirectory += dir + "/"
strdirectory = strdirectory[:-3]
self.currentDirectory = strdirectory
return self.currentDirectory
else:
dirName = self.sanitizeDirectory(dirName) dirName = self.sanitizeDirectory(dirName)
self.currentDirectory = self.currentDirectory + "/" + dirName self.currentDirectory = self.currentDirectory + "/" + dirName
return self.currentDirectory return self.currentDirectory