From 547fda14c57b462cef720adf3e9b35c4177d4080 Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Thu, 27 Nov 2025 20:39:41 -0800 Subject: [PATCH] feat: generate teapot.env first --- bin/joj3-forge-convert | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/bin/joj3-forge-convert b/bin/joj3-forge-convert index 865f904..d60a2f4 100755 --- a/bin/joj3-forge-convert +++ b/bin/joj3-forge-convert @@ -59,23 +59,6 @@ EOF fi rsync -a "$config_repo_path/home/tt/.ssh/" "/home/tt/.ssh" rsync -a --delete "$config_repo_path/home/tt/.config/" "/home/tt/.config" - joj3-forge convert "/home/tt/.config/joj" - rsync -a --delete "/home/tt/.config/joj/" "$config_repo_path/home/tt/.config/joj" - - # enforce correct permissions - chmod 751 "/home/tt/" - chmod 750 "/home/tt/.cache/" || true - chmod 750 "/home/tt/.cache/joj3" || true - chmod 700 "/home/tt/.ssh/" || true - chmod 700 "/home/tt/.config/" - - # commit config changes - git -C "$config_repo_path" add home/tt/.config/joj - if ! git -C "$config_repo_path" diff --staged --quiet; then - commit_hash=$(git -C "$config_repo_path" rev-parse HEAD) - git -C "$config_repo_path" commit -m "chore: $commit_hash trigger joj3-forge convert [skip ci]" - git -C "$config_repo_path" push - fi # check gitea token if [ -n "${TEAPOT_GITEA_TOKEN:-}" ]; then @@ -93,6 +76,24 @@ EOF echo "FATAL: TEAPOT_GITEA_TOKEN not set, ask admin to set it" >&2 exit 1 fi + + joj3-forge convert "/home/tt/.config/joj" + rsync -a --delete "/home/tt/.config/joj/" "$config_repo_path/home/tt/.config/joj" + + # enforce correct permissions + chmod 751 "/home/tt/" + chmod 750 "/home/tt/.cache/" || true + chmod 750 "/home/tt/.cache/joj3" || true + chmod 700 "/home/tt/.ssh/" || true + chmod 700 "/home/tt/.config/" + + # commit config changes + git -C "$config_repo_path" add home/tt/.config/joj + if ! git -C "$config_repo_path" diff --staged --quiet; then + commit_hash=$(git -C "$config_repo_path" rev-parse HEAD) + git -C "$config_repo_path" commit -m "chore: $commit_hash trigger joj3-forge convert [skip ci]" + git -C "$config_repo_path" push + fi } main "$@"