feat: add automatic update check on session start

- Added check-updates script to package.json
- SessionStart hook fetches latest version from GitHub
- Compares local and remote versions
- Shows update notification when newer version available
- Works even after disconnecting from original repo
- Also improved release command documentation with clearer semver guidance
This commit is contained in:
Noah Brier
2025-09-13 20:38:39 -04:00
parent 483ec32707
commit fcc220c135
3 changed files with 45 additions and 6 deletions
+2 -1
View File
@@ -15,7 +15,8 @@
"attachments:orphans": "for file in 05_Attachments/*; do basename \"$file\" | xargs -I {} sh -c 'grep -r \"{}\" . --include=\"*.md\" > /dev/null || echo \"{}\"'; done",
"attachments:recent": "find 05_Attachments -type f -mtime -7 -exec ls -la {} \\;",
"attachments:create-organized": "mkdir -p 05_Attachments/Organized",
"vault:stats": ".scripts/vault-stats.sh"
"vault:stats": ".scripts/vault-stats.sh",
"check-updates": "REMOTE=$(curl -s https://raw.githubusercontent.com/heyitsnoah/claudesidian/main/package.json | grep version | head -1 | sed 's/.*: \"\\(.*\\)\".*/\\1/') && LOCAL=$(grep version package.json | head -1 | sed 's/.*: \"\\(.*\\)\".*/\\1/') && if [ \"$LOCAL\" != \"$REMOTE\" ]; then echo \"{\\\"hookSpecificOutput\\\":{\\\"hookEventName\\\":\\\"SessionStart\\\",\\\"additionalContext\\\":\\\"📦 Update available! Latest: $REMOTE (you have: $LOCAL)\\\\nRun /upgrade to update.\\\"}}\"; fi"
},
"keywords": [
"obsidian",