forked from Onyva/onyva-login-skill
add marketplace
This commit is contained in:
49
install.sh
Normal file
49
install.sh
Normal file
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
PLUGIN_NAME="onyva-login"
|
||||
MARKETPLACE="onyva"
|
||||
VERSION="1.0.0"
|
||||
REPO="https://gitea.onyva.dev/Onyva/onyva-login-skill"
|
||||
INSTALL_DIR="$HOME/.claude/plugins/cache/$MARKETPLACE/$PLUGIN_NAME/$VERSION"
|
||||
PLUGINS_JSON="$HOME/.claude/plugins/installed_plugins.json"
|
||||
|
||||
echo "Installing $PLUGIN_NAME..."
|
||||
|
||||
# Download plugin files
|
||||
mkdir -p "$INSTALL_DIR/skills/$PLUGIN_NAME"
|
||||
curl -fsSL "$REPO/raw/branch/main/.claude-plugin/plugin.json" -o "$INSTALL_DIR/plugin.json"
|
||||
curl -fsSL "$REPO/raw/branch/main/skills/$PLUGIN_NAME/SKILL.md" -o "$INSTALL_DIR/skills/$PLUGIN_NAME/SKILL.md"
|
||||
curl -fsSL "$REPO/raw/branch/main/README.md" -o "$INSTALL_DIR/README.md"
|
||||
|
||||
# Update installed_plugins.json
|
||||
PLUGIN_KEY="${PLUGIN_NAME}@${MARKETPLACE}"
|
||||
NOW=$(date -u +"%Y-%m-%dT%H:%M:%S.000Z")
|
||||
|
||||
if [ ! -f "$PLUGINS_JSON" ]; then
|
||||
echo '{"version":2,"plugins":{}}' > "$PLUGINS_JSON"
|
||||
fi
|
||||
|
||||
# Add entry using python (available everywhere)
|
||||
python3 - <<EOF
|
||||
import json, sys
|
||||
|
||||
path = "$PLUGINS_JSON"
|
||||
with open(path) as f:
|
||||
data = json.load(f)
|
||||
|
||||
data.setdefault("plugins", {})["$PLUGIN_KEY"] = [{
|
||||
"scope": "user",
|
||||
"installPath": "$INSTALL_DIR",
|
||||
"version": "$VERSION",
|
||||
"installedAt": "$NOW",
|
||||
"lastUpdated": "$NOW"
|
||||
}]
|
||||
|
||||
with open(path, "w") as f:
|
||||
json.dump(data, f, indent=2)
|
||||
|
||||
print("Updated installed_plugins.json")
|
||||
EOF
|
||||
|
||||
echo "✓ $PLUGIN_NAME installed. Restart Claude Code to use /onyva-login"
|
||||
Reference in New Issue
Block a user