Skip to content

Commit 53707f3

Browse files
committed
Simplify prune xtask while making it more thorough.
1 parent a6c49d1 commit 53707f3

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

x.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import argparse
44
import os
5-
import shutil
65
import subprocess
76
import sys
87
from pathlib import Path
@@ -128,17 +127,7 @@ def format_(args):
128127

129128

130129
def prune(args):
131-
shutil.rmtree("target", ignore_errors=True)
132-
Path("Cargo.lock").unlink(missing_ok=True)
133-
134-
for target_dir in gen_examples("target"):
135-
shutil.rmtree(target_dir, ignore_errors=True)
136-
137-
for lock_file in gen_examples("Cargo.lock"):
138-
lock_file.unlink(missing_ok=True)
139-
140-
for nox_dir in gen_examples(".nox"):
141-
shutil.rmtree(nox_dir, ignore_errors=True)
130+
run("git", "clean", "--force", "-x", ".")
142131

143132

144133
if __name__ == "__main__":

0 commit comments

Comments
 (0)