Skip to content

Commit

Permalink
use git to cleanup worktree
Browse files Browse the repository at this point in the history
This is faster and less code than using python
  • Loading branch information
Mic92 committed Aug 13, 2023
1 parent 236bc17 commit b4fd237
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions nixpkgs_review/builddir.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def __init__(self, name: str) -> None:

self.worktree_dir = self.path.joinpath("nixpkgs")
self.worktree_dir.mkdir()
self.worktree_dir = self.worktree_dir

os.environ["NIX_PATH"] = self.nixpkgs_path()

Expand All @@ -73,7 +72,6 @@ def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None:
os.environ.update(self.environ)

with DisableKeyboardInterrupt():
shutil.rmtree(self.worktree_dir)
sh(["git", "worktree", "prune"])
sh(["git", "worktree", "remove", "-f", str(self.worktree_dir)])

self.overlay.cleanup()

0 comments on commit b4fd237

Please sign in to comment.