SessionStart Hook hinzugefügt
- hooks/session-start.sh prüft auf Updates im Repo - settings.json mit Hook-Konfiguration erweitert - $HOME statt hardcoded Pfad für Geräte-Kompatibilität Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
22
hooks/session-start.sh
Executable file
22
hooks/session-start.sh
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Claude Code Session-Start Hook
|
||||||
|
# Prüft auf Updates im Settings-Repo
|
||||||
|
|
||||||
|
REPO_DIR="$HOME/dotfiles/claude_settings"
|
||||||
|
|
||||||
|
cd "$REPO_DIR" 2>/dev/null || exit 0
|
||||||
|
|
||||||
|
# Fetch ohne Output
|
||||||
|
git fetch origin --quiet 2>/dev/null || exit 0
|
||||||
|
|
||||||
|
# Prüfe ob Updates vorhanden
|
||||||
|
LOCAL=$(git rev-parse HEAD 2>/dev/null)
|
||||||
|
REMOTE=$(git rev-parse origin/main 2>/dev/null)
|
||||||
|
|
||||||
|
if [ "$LOCAL" != "$REMOTE" ]; then
|
||||||
|
BEHIND=$(git rev-list HEAD..origin/main --count 2>/dev/null)
|
||||||
|
echo "⚠ Claude Settings: $BEHIND neue Commits verfügbar!"
|
||||||
|
echo " → cd ~/dotfiles/claude_settings && git pull"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
@@ -1,9 +1,22 @@
|
|||||||
{
|
{
|
||||||
"statusLine": {
|
"statusLine": {
|
||||||
"type": "command",
|
"type": "command",
|
||||||
"command": "/home/rwiegand/.claude/statusline-command.sh"
|
"command": "$HOME/.claude/statusline-command.sh"
|
||||||
},
|
},
|
||||||
"enabledPlugins": {
|
"enabledPlugins": {
|
||||||
"superpowers@claude-plugins-official": true
|
"superpowers@claude-plugins-official": true
|
||||||
|
},
|
||||||
|
"hooks": {
|
||||||
|
"SessionStart": [
|
||||||
|
{
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "$HOME/.claude/hooks/session-start.sh",
|
||||||
|
"timeout": 30
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user