before doc changes
authorThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Sat, 20 Jun 2026 15:54:45 +0000 (15:54 +0000)
committerThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Sat, 20 Jun 2026 15:54:45 +0000 (15:54 +0000)
shared/linked-project/.gitignore [new file with mode: 0644]
shared/linked-project/.gitkeep [deleted file]
shared/tool/link-RT [new file with mode: 0755]

diff --git a/shared/linked-project/.gitignore b/shared/linked-project/.gitignore
new file mode 100644 (file)
index 0000000..2762afa
--- /dev/null
@@ -0,0 +1,6 @@
+# Ignore all files
+*
+
+# But don't ignore the .gitignore file itself
+!/.gitignore
+
diff --git a/shared/linked-project/.gitkeep b/shared/linked-project/.gitkeep
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/shared/tool/link-RT b/shared/tool/link-RT
new file mode 100755 (executable)
index 0000000..0e15005
--- /dev/null
@@ -0,0 +1,45 @@
+#!/usr/bin/env python3
+import os
+import sys
+import shutil
+from pathlib import Path
+
+def run():
+    repo_home_env = os.environ.get('REPO_HOME')
+    if not repo_home_env:
+        print("Error: REPO_HOME environment variable is missing.", file=sys.stderr)
+        sys.exit(1)
+
+    repo_home = Path(repo_home_env)
+    
+    # Define the canonical target location
+    target_src = repo_home / 'shared' / 'linked-project' / 'RT-style-JS_public' / 'consumer' / 'release' / 'RT'
+
+    # Determine the destination directory
+    if len(sys.argv) > 1:
+        dest_dir = Path(sys.argv[1]).resolve()
+    else:
+        dest_dir = Path.cwd()
+
+    if not dest_dir.is_dir():
+        print(f"Error: Directory '{dest_dir}' does not exist.", file=sys.stderr)
+        sys.exit(1)
+
+    link_dest = dest_dir / 'RT'
+
+    # Clobber existing file, link, or directory named 'RT'
+    if link_dest.is_symlink() or link_dest.is_file():
+        link_dest.unlink()
+    elif link_dest.is_dir():
+        shutil.rmtree(link_dest)
+
+    # Establish the new symbolic link
+    try:
+        link_dest.symlink_to(target_src)
+        print(f"Established link: {link_dest} -> {target_src}")
+    except OSError as e:
+        print(f"Failed to establish link: {e}", file=sys.stderr)
+        sys.exit(1)
+
+if __name__ == '__main__':
+    run()
\ No newline at end of file