diff options
| author | Teddy Wing | 2016-07-21 21:23:15 -0400 |
|---|---|---|
| committer | Teddy Wing | 2016-07-21 21:23:15 -0400 |
| commit | e09b306850f080d3deeb8660243baa7ec0282f37 (patch) | |
| tree | 5fa0ea38bc52ab54bb80f52befd15a1cddfab9f1 | |
| parent | 594318f73b5188f3d3bebfbcd9f08b69993615fa (diff) | |
| download | qcd-e09b306850f080d3deeb8660243baa7ec0282f37.tar.bz2 | |
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.
| -rwxr-xr-x | qcd | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 ;; |
