From 2aacf2b88e3185dc5a848fb875ced414ce68f066 Mon Sep 17 00:00:00 2001 From: Thomas Walker Lynch Date: Fri, 6 Mar 2026 14:45:31 +0000 Subject: [PATCH] local document style working --- administrator/document/setup.js | 4 ++-- developer/document/setup.js | 4 ++-- document/setup.js | 4 ++-- shared/document/setup.js | 4 ++-- shared/style_directory_dict.js | 2 +- temp.sh | 31 +++++++++++++++++++++++++++++++ 6 files changed, 40 insertions(+), 9 deletions(-) create mode 100755 temp.sh diff --git a/administrator/document/setup.js b/administrator/document/setup.js index bffdab2..77ec522 100644 --- a/administrator/document/setup.js +++ b/administrator/document/setup.js @@ -1,4 +1,4 @@ window.RT_REPO_ROOT = "../../"; document.write(''); -document.write(''); -document.write(''); +document.write(''); +document.write(''); diff --git a/developer/document/setup.js b/developer/document/setup.js index bffdab2..77ec522 100644 --- a/developer/document/setup.js +++ b/developer/document/setup.js @@ -1,4 +1,4 @@ window.RT_REPO_ROOT = "../../"; document.write(''); -document.write(''); -document.write(''); +document.write(''); +document.write(''); diff --git a/document/setup.js b/document/setup.js index ca24761..65d8522 100644 --- a/document/setup.js +++ b/document/setup.js @@ -1,4 +1,4 @@ window.RT_REPO_ROOT = "../"; document.write(''); -document.write(''); -document.write(''); +document.write(''); +document.write(''); diff --git a/shared/document/setup.js b/shared/document/setup.js index bffdab2..77ec522 100644 --- a/shared/document/setup.js +++ b/shared/document/setup.js @@ -1,4 +1,4 @@ window.RT_REPO_ROOT = "../../"; document.write(''); -document.write(''); -document.write(''); +document.write(''); +document.write(''); diff --git a/shared/style_directory_dict.js b/shared/style_directory_dict.js index cdd9138..5c08723 100644 --- a/shared/style_directory_dict.js +++ b/shared/style_directory_dict.js @@ -1,4 +1,4 @@ window.StyleRT_namespaces = { - "RT": window.RT_REPO_ROOT + "shared/third_party/RT-style-JS_public/consumer/release/RT" + "RT": window.RT_REPO_ROOT + "developer/authored/RT" ,"Project": window.RT_REPO_ROOT + "shared/authored/style" }; diff --git a/temp.sh b/temp.sh new file mode 100755 index 0000000..fc2dc3d --- /dev/null +++ b/temp.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -euo pipefail + +CLI(){ + local doc_dirs=$(find . -type d -name "document" -not -path "*/\.git/*" -not -path "*/shared/third_party/*") + + for doc_dir in $doc_dirs; do + local clean_dir="${doc_dir#./}" + + local rel_root="" + IFS='/' read -ra parts <<< "$clean_dir" + for part in "${parts[@]}"; do + rel_root="../${rel_root}" + done + + local setup_file="${clean_dir}/setup.js" + + cat < "${setup_file}" +window.RT_REPO_ROOT = "${rel_root}"; +document.write(''); +document.write(''); +document.write(''); +EOF + + echo "Wrote ${setup_file} using RT_REPO_ROOT = '${rel_root}'" + done +} + +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + CLI "$@" +fi -- 2.20.1