Skip to content

Commit d3ad068

Browse files
committed
Copy plugins more carefully
1 parent 4866c2a commit d3ad068

2 files changed

Lines changed: 21 additions & 22 deletions

File tree

build.py

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -92,25 +92,24 @@
9292
else:
9393
print(f"Successfully built: {target}")
9494
format_path = os.path.join(plugins_dir, fmt)
95+
target_dir = os.path.join(build_output_dir, fmt)
9596

96-
for pdb_file in Path(format_path).resolve().rglob("*.pdb"):
97-
try:
98-
pdb_file.unlink()
99-
except Exception as e:
100-
print(f"Failed to remove {pdb_file}: {e}")
101-
102-
# weird plugdata build trash on Windows for some reason
103-
for trash in Path(format_path).resolve().rglob("plugdata.*"):
104-
try:
105-
if trash.is_dir():
106-
shutil.rmtree(trash)
107-
except Exception as e:
108-
print(f"Failed to remove {trash}: {e}")
109-
110-
if os.path.isdir(format_path):
111-
target_dir = os.path.join(build_output_dir, fmt)
112-
113-
# Clear existing target folder if it exists, then copy
114-
if os.path.exists(target_dir):
115-
shutil.rmtree(target_dir)
116-
shutil.copytree(format_path, target_dir)
97+
if fmt == "Standalone":
98+
if os.path.isdir(format_path):
99+
if os.path.exists(target_dir):
100+
shutil.rmtree(target_dir)
101+
shutil.copytree(format_path, target_dir)
102+
else:
103+
extension = ""
104+
if fmt == "VST3":
105+
extension = ".vst3"
106+
elif fmt == "AU":
107+
extension = ".component"
108+
elif fmt == "LV2":
109+
extension = ".lv2"
110+
elif fmt == "CLAP":
111+
extension = ".clap"
112+
113+
plugin_filename = name + extension;
114+
os.makedirs(target_dir, exist_ok=True)
115+
shutil.copytree(os.path.join(format_path, plugin_filename), os.path.join(target_dir, plugin_filename))

plugdata

0 commit comments

Comments
 (0)