Files
claude-marketplace/push-to-gitea.sh
T

44 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# push-to-gitea.sh — publish THIS folder (the marketplace root) to your Gitea
# repo l.kirchner/claude-marketplace. Run from inside this folder.
#
# The repo was created empty, so this sets up clean history with your first push.
# Commits use your local git signing config (commit.gpgsign etc.) untouched.
#
# ./push-to-gitea.sh
# REMOTE_URL=https://gitea.luki-net.org/l.kirchner/claude-marketplace.git ./push-to-gitea.sh
set -euo pipefail
REMOTE_URL="${REMOTE_URL:-ssh://git@gitea.luki-net.org:2222/l.kirchner/claude-marketplace.git}"
BRANCH="${BRANCH:-main}"
[ -f ".claude-plugin/marketplace.json" ] || {
echo "ERROR: run this from the marketplace root (no .claude-plugin/marketplace.json here)." >&2
exit 1
}
if [ ! -d .git ]; then
git init -b "$BRANCH"
fi
if git remote get-url origin >/dev/null 2>&1; then
git remote set-url origin "$REMOTE_URL"
else
git remote add origin "$REMOTE_URL"
fi
git add -A
# --gpg-sign respects your config; drop the flag if you don't sign locally.
git commit -m "feat: knowledge-curator plugin + marketplace manifest" || {
echo "Nothing to commit (already committed?). Continuing to push." >&2
}
git push -u origin "$BRANCH"
cat <<EOF
>> Pushed to $REMOTE_URL ($BRANCH)
>> In Claude Code:
/plugin marketplace add https://gitea.luki-net.org/l.kirchner/claude-marketplace
/plugin install knowledge-curator@luki-net
EOF