mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 14:23:53 +00:00
Revert "Fix dev_environment.py Windows compatibility for symlink handling"
This reverts commit a37de44a24.
This commit is contained in:
@@ -117,30 +117,10 @@ def main() -> None:
|
|||||||
# (they could be disabled by default on Windows).
|
# (they could be disabled by default on Windows).
|
||||||
subprocess.check_call(("git", "config", "--local", "core.symlinks", "true"), cwd=REPO_PATH)
|
subprocess.check_call(("git", "config", "--local", "core.symlinks", "true"), cwd=REPO_PATH)
|
||||||
symlinks_glob = "src/bonsai/bonsai/bim/data/templates/projects/*.ifc"
|
symlinks_glob = "src/bonsai/bonsai/bim/data/templates/projects/*.ifc"
|
||||||
symlink_paths = list(REPO_PATH.glob(symlinks_glob))
|
# Delete and checkout is the only way to ensure files are added as symlinks.
|
||||||
|
for path in REPO_PATH.glob(symlinks_glob):
|
||||||
# Check if symlinks already exist and are valid
|
path.unlink()
|
||||||
all_symlinks_valid = symlink_paths and all(p.is_symlink() for p in symlink_paths)
|
subprocess.check_call(("git", "checkout", "--", symlinks_glob), cwd=REPO_PATH)
|
||||||
|
|
||||||
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.")
|
|
||||||
|
|
||||||
print("Copying compiled dependencies to the repo...")
|
print("Copying compiled dependencies to the repo...")
|
||||||
dest = REPO_PATH / "src" / "ifcopenshell-python" / "ifcopenshell"
|
dest = REPO_PATH / "src" / "ifcopenshell-python" / "ifcopenshell"
|
||||||
|
|||||||
Reference in New Issue
Block a user