"""Build a GDExtension-free staging project; leaves desktop import plugin intact.""" from pathlib import Path import shutil root = Path(__file__).resolve().parents[1] stage = root/'build/web-stage' if stage.exists(): shutil.rmtree(stage) stage.mkdir(parents=True) for directory in ['scripts','scenes','assets']: shutil.copytree(root/directory,stage/directory,ignore=shutil.ignore_patterns('*.mdl','*.import','*.uid','half_life_manifest.json','p_9mmar.scn','w_9mmar.scn')) config=(root/'project.godot').read_text().replace('enabled=PackedStringArray("res://addons/goldsrc/plugin.cfg")','enabled=PackedStringArray()') config=config.replace('renderer/rendering_method="forward_plus"','renderer/rendering_method="gl_compatibility"') (stage/'project.godot').write_text(config) shutil.copyfile(root/'export_presets.cfg',stage/'export_presets.cfg') print(stage)