From e09b306850f080d3deeb8660243baa7ec0282f37 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 21 Jul 2016 21:23:15 -0400 Subject: qcd: Rename `find_shortcut` function to `shortcut_exists` This name makes more sense since it's meant for a test and doesn't return any information about the shortcut. --- qcd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qcd b/qcd index ebd68a4..b069963 100755 --- a/qcd +++ b/qcd @@ -30,7 +30,7 @@ function absolute_path () { (cd "$(dirname '$1')" &>/dev/null && printf "%s/%s" "$PWD" "${1##*/}") } -function find_shortcut () { +function shortcut_exists () { local shortcut=$1 return $(awk '{ print $1 }' $QCD_DATABASE_FILE | grep "^${shortcut}$" >/dev/null 2>&1; echo $?) } @@ -51,7 +51,7 @@ function qcd () { local path=$3 # Don't add the shortcut if it already exists - if ! find_shortcut $shortcut; then + if ! shortcut_exists $shortcut; then echo "${shortcut} $(absolute_path ${path})" >> $QCD_DATABASE_FILE fi ;; -- cgit v1.2.3