diff --git a/bookstack_file_exporter/archiver/archiver.py b/bookstack_file_exporter/archiver/archiver.py index 7d64110..706ed56 100644 --- a/bookstack_file_exporter/archiver/archiver.py +++ b/bookstack_file_exporter/archiver/archiver.py @@ -42,7 +42,14 @@ def create_export_dir(self): return log.info("Creating base directory for archive: %s", self.config.user_inputs.output_path) - util.create_dir(self.config.user_inputs.output_path) + # in docker, this may fail if the user id is not the same as the host + try: + util.create_dir(self.config.user_inputs.output_path) + except PermissionError as perm_err: + log.warning("Failed to create base directory: %s", perm_err) + log.warning("This usually occurs in docker environments, \ + attempting to skip this step") + return def get_bookstack_exports(self, page_nodes: Dict[int, Node]): """export all page content""" diff --git a/bookstack_file_exporter/archiver/page_archiver.py b/bookstack_file_exporter/archiver/page_archiver.py index 84ba201..fba5047 100644 --- a/bookstack_file_exporter/archiver/page_archiver.py +++ b/bookstack_file_exporter/archiver/page_archiver.py @@ -142,7 +142,7 @@ def archive_page_assets(self, asset_type: str, parent_path: str, page_name: str, return {} # use a map for faster lookup failed_assets = {} - node_base_path = f"{self.archive_base_path}/{parent_path}/" + node_base_path = f"{self.archive_base_path}/{parent_path}" for asset_node in asset_nodes: try: asset_data = self.asset_archiver.get_asset_bytes(asset_type, asset_node.url)