do not allow getting out
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Torma Kristóf 2021-04-29 17:45:23 +02:00
parent fe26bd1727
commit ec5a36c700
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047
1 changed files with 3 additions and 0 deletions

View File

@ -39,8 +39,11 @@ class Executor:
p = Path(os.path.join(self.baseDir, self.currentDirectory))
parentpath = p.parent
if (str(parentpath) + os.path.sep)== self.baseDir:
self.currentDirectory = ""
return self.currentDirectory
else:
if len(str(parentpath).split('/')) < len(self.baseDir.split('/')):
return self.currentDirectory
newpath = str(parentpath).replace(self.baseDir,'')
if os.path.exists(os.path.join(self.baseDir,newpath)):
self.currentDirectory = newpath