Files
omarchy/bin/omarchy-update-available
David Heinemeier Hansson 631b62927a Better than doing string comparison
Any tag difference means new release
2025-08-02 22:14:16 +02:00

14 lines
467 B
Bash
Executable File

#!/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