From cd6e531120f2ec4b76a89fd37429c611a471fa69 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Fri, 13 Feb 2026 09:14:35 +1100 Subject: [PATCH] Revert "Fix dev_environment.py Windows compatibility for symlink handling" This reverts commit a37de44a24b8495be69f91952b53abf3ef6fa5b9. --- src/bonsai/scripts/dev_environment.py | 28 ++++----------------------- 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/src/bonsai/scripts/dev_environment.py b/src/bonsai/scripts/dev_environment.py index 6889a79f3e..4598d0bf49 100644 --- a/src/bonsai/scripts/dev_environment.py +++ b/src/bonsai/scripts/dev_environment.py @@ -117,30 +117,10 @@ def main() -> None: # (they could be disabled by default on Windows). subprocess.check_call(("git", "config", "--local", "core.symlinks", "true"), cwd=REPO_PATH) symlinks_glob = "src/bonsai/bonsai/bim/data/templates/projects/*.ifc" - symlink_paths = list(REPO_PATH.glob(symlinks_glob)) - - # Check if symlinks already exist and are valid - all_symlinks_valid = symlink_paths and all(p.is_symlink() for p in symlink_paths) - - if not all_symlinks_valid: - # Delete existing files/broken symlinks and recreate from git - for path in symlink_paths: - path.unlink() - # Refresh git index to recognize deleted files - subprocess.run(("git", "update-index", "--refresh"), cwd=REPO_PATH, capture_output=True) - # Get tracked files matching the glob (git checkout with glob doesn't work on Windows) - result = subprocess.run( - ("git", "ls-files", symlinks_glob), - cwd=REPO_PATH, - capture_output=True, - text=True, - check=True, - ) - for file_path in result.stdout.strip().split("\n"): - if file_path: - subprocess.check_call(("git", "checkout", "HEAD", "--", file_path), cwd=REPO_PATH) - else: - print("Symlinks already exist and are valid, skipping recreation.") + # Delete and checkout is the only way to ensure files are added as symlinks. + for path in REPO_PATH.glob(symlinks_glob): + path.unlink() + subprocess.check_call(("git", "checkout", "--", symlinks_glob), cwd=REPO_PATH) print("Copying compiled dependencies to the repo...") dest = REPO_PATH / "src" / "ifcopenshell-python" / "ifcopenshell"