From f3666204183eca2c3ba172fd21d49b437d4276ef Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 16 Nov 2024 02:55:41 +0100 Subject: [PATCH] =?UTF-8?q?=E2=88=92type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/shell.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/shell/shell.sh b/shell/shell.sh index b984e6c..5e100fa 100644 --- a/shell/shell.sh +++ b/shell/shell.sh @@ -49,14 +49,13 @@ esac # prompt ps1() { - local date host id type + local date host id local code="${1}" date="$(date +%H:%M:%S)" local git host="$(hostname)" id="$(id --user)" local path="${PWD}" - type="$(type -t __git_ps1)" local user="${USER}" local view="└ " # code @@ -70,7 +69,7 @@ ps1() { view="${view}${SH_DEFAULT} @ " view="${view}${SH_BROWN}${date}" # git - if [ "${type}" = "function" ]; then + if command -v "__git_ps1" >"/dev/null"; then git="$(__git_ps1)" if [ -n "${git}" ]; then view="${view}${SH_DEFAULT} –${SH_MAGENTA}${git}"