Files
arthur-os/bin/omarchy-version-branch
2026-06-04 18:38:25 -04:00

19 lines
484 B
Bash
Executable File

#!/bin/bash
# omarchy:summary=Print the active Omarchy dev-link git branch
# omarchy:hidden=true
omarchy_path=${OMARCHY_PATH:-/usr/share/omarchy}
omarchy_path=${omarchy_path%/}
[[ $omarchy_path != "/usr/share/omarchy" ]] || exit 1
branch=$(git -C "$omarchy_path" branch --show-current 2>/dev/null || true)
if [[ -z $branch ]]; then
hash=$(git -C "$omarchy_path" rev-parse --short HEAD 2>/dev/null || true)
[[ -n $hash ]] || exit 1
branch="detached@$hash"
fi
echo "$branch"