Skip to content

Commit 99a8d94

Browse files
committed
Fix windows trash removal
1 parent c70d778 commit 99a8d94

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

build.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# Detect platform and choose CMake generator
1818
system = platform.system()
1919
if system == "Windows":
20-
cmake_generator = ["-G", "Visual Studio 17 2022"] # You can adjust this if using another version
20+
cmake_generator = ["-G", "Visual Studio 17 2022"]
2121
else:
2222
cmake_generator = ["-G", "Ninja"]
2323

@@ -93,18 +93,18 @@
9393
format_path = os.path.join(plugins_dir, fmt)
9494

9595
for pdb_file in Path(format_path).resolve().rglob("*.pdb"):
96-
try:
97-
pdb_file.unlink()
98-
print(f"Removed: {pdb_file}")
99-
except Exception as e:
100-
print(f"Failed to remove {pdb_file}: {e}")
101-
102-
for trash in Path(format_path).resolve().rglob("plugdata.*"): # weird plugdata build trash on Windows for some reason
103-
try:
104-
trash.unlink()
105-
print(f"Removed: {trash}")
106-
except Exception as e:
107-
print(f"Failed to remove {trash}: {e}")
96+
try:
97+
pdb_file.unlink()
98+
except Exception as e:
99+
print(f"Failed to remove {pdb_file}: {e}")
100+
101+
# weird plugdata build trash on Windows for some reason
102+
for trash in Path(format_path).resolve().rglob("plugdata.*"):
103+
try:
104+
if trash.is_dir():
105+
shutil.rmtree(trash)
106+
except Exception as e:
107+
print(f"Failed to remove {trash}: {e}")
108108

109109
if os.path.isdir(format_path):
110110
target_dir = os.path.join(build_output_dir, fmt)

0 commit comments

Comments
 (0)