From 4f610a1ad76982b5a9746f88e95d216d1b5732f2 Mon Sep 17 00:00:00 2001 From: Lazarus Lazaridis Date: Tue, 6 Mar 2018 12:03:22 +0200 Subject: [PATCH] Display informative text if no aliases exist upon listing. Fixes #5. --- goto.bash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/goto.bash b/goto.bash index ddcb416..28b42db 100644 --- a/goto.bash +++ b/goto.bash @@ -90,7 +90,11 @@ function _goto_expand_directory() function _goto_list_aliases() { local IFS=$'\n' - echo "$(sed '/^\s*$/d' ~/.goto)" + if [ -f ~/.goto ]; then + echo "$(sed '/^\s*$/d' ~/.goto 2>/dev/null)" + else + echo "You haven't configured any directory aliases yet." + fi } # Registers and alias.