mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 00:29:43 -04:00
check git tags too
This commit is contained in:
parent
61a601a962
commit
6f756b7af0
1 changed files with 5 additions and 1 deletions
|
|
@ -98,7 +98,11 @@ check_project() {
|
||||||
|
|
||||||
if [ -n "$git_root" ]; then
|
if [ -n "$git_root" ]; then
|
||||||
local git_branch=$(git branch --show-current 2>/dev/null)
|
local git_branch=$(git branch --show-current 2>/dev/null)
|
||||||
|
|
||||||
|
if [ -z "$git_branch" ]; then
|
||||||
|
git_branch=$(git describe --tags --exact-match 2>/dev/null)
|
||||||
git_branch=''${git_branch:-$(git rev-parse --short HEAD 2>/dev/null)}
|
git_branch=''${git_branch:-$(git rev-parse --short HEAD 2>/dev/null)}
|
||||||
|
fi
|
||||||
|
|
||||||
local git_curr_dir=$(relative_path "." "$git_root")
|
local git_curr_dir=$(relative_path "." "$git_root")
|
||||||
local git_root_dir=$(basename "$git_root")
|
local git_root_dir=$(basename "$git_root")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue