diff --git a/.doctrees/environment.pickle b/.doctrees/environment.pickle index 79dcd69..92207b1 100644 Binary files a/.doctrees/environment.pickle and b/.doctrees/environment.pickle differ diff --git a/_modules/sphinx_deployment/cli.html b/_modules/sphinx_deployment/cli.html index b9e9892..8237dc5 100644 --- a/_modules/sphinx_deployment/cli.html +++ b/_modules/sphinx_deployment/cli.html @@ -539,7 +539,7 @@

Source code for sphinx_deployment.cli

     )
     _ = sync_remote(remote, branch)
 
-    version_path = Path(output_path).joinpath("versions.json")
+    version_path = Path(output_path) / "versions.json"
     versions = list_versions(branch, str(version_path))
     v = versions.add(version)
     if versions.default == "":
@@ -557,7 +557,7 @@ 

Source code for sphinx_deployment.cli

                 f"with sphinx-deployment {__version__}"
             )
 
-        t = redirect_impl(DIR.joinpath("templates"))
+        t = redirect_impl(DIR / "templates")
         redirect_render = t.render(href_to_ver=version + "/index.html")
 
         with commit_changes(".", message) as repo:
@@ -568,11 +568,11 @@ 

Source code for sphinx_deployment.cli

             else:
                 rp.heads[branch].checkout()
 
-            dest_dir = Path(output_path).joinpath(v.version)
+            dest_dir = Path(output_path) / v.version
             shutil.copytree(tmp, str(dest_dir), dirs_exist_ok=True)
             rp.index.add([str(dest_dir)])
 
-            redirect_html = Path(output_path).joinpath("index.html")
+            redirect_html = Path(output_path) / "index.html"
             if not redirect_html.exists():
                 with redirect_html.open(
                     mode="w",
@@ -581,7 +581,7 @@ 

Source code for sphinx_deployment.cli

                     f.write(redirect_render)
                 rp.index.add([str(redirect_html)])
 
-            nojekyll = Path(output_path).joinpath(".nojekyll")
+            nojekyll = Path(output_path) / ".nojekyll"
             if not nojekyll.exists():
                 nojekyll.touch()
                 rp.index.add([str(nojekyll)])
@@ -612,7 +612,7 @@ 

Source code for sphinx_deployment.cli

     if not sync_remote(remote, branch):
         logger.warning(f"Sync failed in remote: {remote}")
 
-    version_path = Path(output_path).joinpath("versions.json")
+    version_path = Path(output_path) / "versions.json"
     versions = list_versions(branch, str(version_path))
 
     message = f"Deleted {delete_version} from {branch}"
@@ -622,8 +622,9 @@ 

Source code for sphinx_deployment.cli

 
         for del_ver in delete_version:
             versions.versions.pop(del_ver)
-            dest_dir = Path(output_path).joinpath(del_ver)
-            rp.index.remove([str(dest_dir)])
+            dest_dir = Path(output_path) / del_ver
+            shutil.rmtree(str(dest_dir), ignore_errors=True)
+            rp.index.add([str(dest_dir)])
 
         dump_versions(str(version_path), versions)
         rp.index.add([str(version_path)])
@@ -656,7 +657,7 @@ 

Source code for sphinx_deployment.cli

         logger.warning(f"Sync failed in remote: {remote}")
         return
 
-    version_path = Path(output_path).joinpath("versions.json")
+    version_path = Path(output_path) / "versions.json"
     versions = list_versions(branch, str(version_path))
 
     if version not in versions.versions:
@@ -665,13 +666,13 @@ 

Source code for sphinx_deployment.cli

 
     versions.default = version
 
-    t = redirect_impl(DIR.joinpath("templates"))
+    t = redirect_impl(DIR / "templates")
 
     with commit_changes(".", message) as repo:
         rp: Repo = repo
         rp.heads[branch].checkout()
 
-        root_redirect = Path(output_path).joinpath("index.html")
+        root_redirect = Path(output_path) / "index.html"
         with root_redirect.open(
             mode="w",
             encoding="utf-8",
@@ -707,7 +708,7 @@ 

Source code for sphinx_deployment.cli

     if not sync_remote(remote, branch):
         logger.warning(f"Sync failed in remote: {remote}")
 
-    version_path = Path(output_path).joinpath("versions.json")
+    version_path = Path(output_path) / "versions.json"
     versions = list_versions(branch, str(version_path))
     logger.debug(json.dumps(asdict(versions), indent=4, separators=(",", ": ")))