Skip to content
Snippets Groups Projects
Commit 7c0c198c authored by Jim MacArthur's avatar Jim MacArthur
Browse files

filebaseddirectory: Update index after descend

parent 975640ae
No related branches found
No related tags found
No related merge requests found
...@@ -95,7 +95,8 @@ class FileBasedDirectory(Directory): ...@@ -95,7 +95,8 @@ class FileBasedDirectory(Directory):
if create: if create:
new_path = os.path.join(self.external_directory, subdirectory_spec[0]) new_path = os.path.join(self.external_directory, subdirectory_spec[0])
os.makedirs(new_path, exist_ok=True) os.makedirs(new_path, exist_ok=True)
return FileBasedDirectory(new_path).descend(subdirectory_spec[1:], create) self.index[subdirectory_spec[0]] = FileBasedDirectory(new_path).descend(subdirectory_spec[1:], create)
return self.index[subdirectory_spec[0]]
else: else:
error = "No entry called '{}' found in the directory rooted at {}" error = "No entry called '{}' found in the directory rooted at {}"
raise VirtualDirectoryError(error.format(subdirectory_spec[0], self.external_directory)) raise VirtualDirectoryError(error.format(subdirectory_spec[0], self.external_directory))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment