Skip to content

Commit

Permalink
Notice branches too.
Browse files Browse the repository at this point in the history
  • Loading branch information
danfuzz committed Feb 29, 2024
1 parent 3b3600c commit 99c9d26
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/lib/bashy-node/node-project/build-main-module
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,18 @@ function commit-info {
infoWords=("$(git rev-parse --short=8 HEAD)") \
|| return "$?"

# If this repo's HEAD is pegged to a tag, this will print it.
infoWords+=($(git tag --points-at HEAD)) \
|| return "$?"

# If this repo's HEAD is on a branch, this will print it.
local headRef
headRef="$(git rev-parse --abbrev-ref HEAD)" \
|| return "$?"
if [[ ${headRef} != 'main' ]]; then
infoWords+=("${headRef}")
fi

echo "${infoWords[*]}"
}

Expand Down

0 comments on commit 99c9d26

Please sign in to comment.