From c707c3fbb2029a5abac4b947949f3ef1472458d2 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 15 Dec 2023 18:21:02 +0100 Subject: [PATCH] Check is eza exists before ls alias overwrite --- zsh/.aliases | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/zsh/.aliases b/zsh/.aliases index ec8c81d..017f447 100644 --- a/zsh/.aliases +++ b/zsh/.aliases @@ -29,11 +29,12 @@ alias python=python3 # eza overide TREE_IGNORE="cache|log|logs|node_modules|vendor" -alias ls=' eza --group-directories-first' -alias la=' ls -a' -alias ll=' ls --git -l' -alias lt=' ls --tree -D -L 2 -I ${TREE_IGNORE}' -alias ltt=' ls --tree -D -L 3 -I ${TREE_IGNORE}' -alias lttt=' ls --tree -D -L 4 -I ${TREE_IGNORE}' -alias ltttt=' ls --tree -D -L 5 -I ${TREE_IGNORE}' - +if type "$foobar_command_name" > /dev/null; then + alias ls=' eza --group-directories-first' + alias la=' ls -a' + alias ll=' ls --git -l' + alias lt=' ls --tree -D -L 2 -I ${TREE_IGNORE}' + alias ltt=' ls --tree -D -L 3 -I ${TREE_IGNORE}' + alias lttt=' ls --tree -D -L 4 -I ${TREE_IGNORE}' + alias ltttt=' ls --tree -D -L 5 -I ${TREE_IGNORE}' +fi