From 004616122241810cf4fd63be8237fc0422b1b2f9 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Mon, 16 May 2022 00:30:01 -0300 Subject: etc/bash/vcs-ps1.sh: Better checking of empty shell variables --- etc/bash/vcs-ps1.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'etc/bash') diff --git a/etc/bash/vcs-ps1.sh b/etc/bash/vcs-ps1.sh index 4b440be..6e74e1d 100644 --- a/etc/bash/vcs-ps1.sh +++ b/etc/bash/vcs-ps1.sh @@ -132,7 +132,7 @@ path() { } guix_env() { - if [ "$GUIX_ENVIRONMENT" != '' ]; then + if [ -n "${GUIX_ENVIRONMENT:-}" ]; then printf '\n' color -c blacki '~> ' color -c purple 'guix environment ' @@ -143,7 +143,7 @@ guix_env() { } in_nix_shell() { - if [ "$IN_NIX_SHELL" != '' ]; then + if [ -n "${IN_NIX_SHELL:-}" ]; then printf '\n' color -c blacki '~> ' color -c purpleb "$IN_NIX_SHELL " -- cgit v1.2.3