From 99c9d261c1af19cbe34eb6a8f91a88bbbdd55243 Mon Sep 17 00:00:00 2001 From: Dan Bornstein Date: Thu, 29 Feb 2024 12:04:29 -0800 Subject: [PATCH] Notice branches too. --- scripts/lib/bashy-node/node-project/build-main-module | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/lib/bashy-node/node-project/build-main-module b/scripts/lib/bashy-node/node-project/build-main-module index 1ce5a89..1e49d7b 100755 --- a/scripts/lib/bashy-node/node-project/build-main-module +++ b/scripts/lib/bashy-node/node-project/build-main-module @@ -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[*]}" }