feat: generate teapot.env first
Some checks failed
push / build (push) Has been cancelled

This commit is contained in:
张泊明518370910136 2025-11-27 20:39:41 -08:00
parent 92245275e7
commit 547fda14c5
GPG Key ID: CA088E6D9284F870

View File

@ -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 "$@"