Show indicator if update is available (#456)

* Show indicator if update is available

* Language
This commit is contained in:
David Heinemeier Hansson
2025-08-02 21:48:06 +02:00
committed by GitHub
parent 63840c6e9a
commit f729004306
4 changed files with 25 additions and 4 deletions

13
bin/omarchy-update-available Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
omarchy_path="$HOME/.local/share/omarchy"
latest_tag=$(git -C $omarchy_path ls-remote --tags origin | grep -v "{}" | awk '{print $2}' | sed 's#refs/tags/##' | sort -V | tail -n 1)
current_tag=$(git -C $omarchy_path describe --tags $(git -C $omarchy_path rev-list --tags --max-count=1))
if [[ "$current_tag" < "$latest_tag" ]]; then
echo "Omarchy update available ($latest_tag)"
exit 0
else
echo "Omarchy is up to date ($current_tag)"
exit 1
fi