1
0
mirror of https://github.com/pi-hole/pi-hole synced 2025-02-07 13:42:40 +00:00

Using more user-friendly messages on git describe failure

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
RD WebDesign 2025-01-13 20:11:41 -03:00
parent 0ae50eab87
commit 254b67bca3
No known key found for this signature in database
GPG Key ID: AE3C7FC910687F33

View File

@ -202,7 +202,7 @@ compare_local_version_to_git_version() {
if git status &> /dev/null; then
# The current version the user is on
local local_version
local_version=$(git describe --tags --abbrev=0 2>&1);
local_version=$(git describe --tags --abbrev=0 2> /dev/null);
# What branch they are on
local local_branch
local_branch=$(git rev-parse --abbrev-ref HEAD);
@ -213,7 +213,13 @@ compare_local_version_to_git_version() {
local local_status
local_status=$(git status -s)
# echo this information out to the user in a nice format
log_write "${TICK} Version: ${local_version}"
if [ ${local_version} ]; then
log_write "${TICK} Version: ${local_version}"
elif [ -n "${DOCKER_VERSION}" ]; then
log_write "${TICK} Version: Pi-hole Docker Container ${COL_BOLD}${DOCKER_VERSION}${COL_NC}"
else
log_write "${CROSS} Version: not detected"
fi
# Print the repo upstreams
remotes=$(git remote -v)