From e87f9611ce061f09596ba600919785cc961e11eb Mon Sep 17 00:00:00 2001 From: Ali Mihandoost Date: Mon, 18 Feb 2019 15:27:43 +0330 Subject: [PATCH] fix(color): skip dircolors command not found --- 1bash.d/0_colors.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/1bash.d/0_colors.sh b/1bash.d/0_colors.sh index ca13dd2..c14697a 100644 --- a/1bash.d/0_colors.sh +++ b/1bash.d/0_colors.sh @@ -1,9 +1,11 @@ #!/bin/bash -if [ -f ~/.dircolors ]; then - eval "$( dircolors -b ~/.dircolors )" -elif [ -f $ONE_BASH/dircolors ]; then - eval "$( dircolors -b $ONE_BASH/dircolors )" +if type dircolors > /dev/null 2>&1; then + if [ -f ~/.dircolors ]; then + eval "$( dircolors -b ~/.dircolors )" + elif [ -f $ONE_BASH/dircolors ]; then + eval "$( dircolors -b $ONE_BASH/dircolors )" + fi fi # Detect which `ls` flavor is in use