From 2b77681763db979ab948e8211ab6227d154e3a7e Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Wed, 1 Mar 2023 03:11:10 +0000 Subject: [PATCH] Move getent check to common.sh --- tools/bin/td | 6 ------ tools/lib/common.sh | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/bin/td b/tools/bin/td index dad09c6..69b19cc 100644 --- a/tools/bin/td +++ b/tools/bin/td @@ -242,12 +242,6 @@ recipe_patch() { MXID="@${USER}:$(hostname)" fi - # If the user has not set their DISPLAY_NAME, try to deduce it - # from their system. - if [ -z "$DISPLAY_NAME" ] && which getent > /dev/null 2>&1; then - DISPLAY_NAME=$(getent passwd "$USER" | cut -d ':' -f 5 | cut -d ',' -f 1) - fi - # If the user has not set their EDITOR, use a safe default. # (vi should be available on any POSIX system) if [ -z "$EDITOR" ]; then diff --git a/tools/lib/common.sh b/tools/lib/common.sh index 95455b5..15852a2 100644 --- a/tools/lib/common.sh +++ b/tools/lib/common.sh @@ -10,7 +10,7 @@ if [ -z "$MXID" ]; then MXID="@${USER}:$(hostname)" fi -if [ -z "$DISPLAY_NAME" ]; then +if [ -z "$DISPLAY_NAME" ] && which getent > /dev/null 2>&1; then DISPLAY_NAME=$(getent passwd "$USER" | cut -d ':' -f 5 | cut -d ',' -f 1) fi