diff options
author | Rasmus Steinke <rasi@xssn.at> | 2015-10-30 20:22:34 +0100 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2015-10-30 20:22:34 +0100 |
commit | b6b45ef91f32024ea0426f6f6e612f69d4d69663 (patch) | |
tree | 4e1c6afc9bcaa2796b5818b57db6f9c7aef93ce8 /clerk | |
parent | 7d972a0890cc3110460768c973d9ec316af8b301 (diff) | |
download | perl-app-clerk-b6b45ef91f32024ea0426f6f6e612f69d4d69663.tar.gz perl-app-clerk-b6b45ef91f32024ea0426f6f6e612f69d4d69663.tar.xz |
dont create cache twice
Diffstat (limited to 'clerk')
-rwxr-xr-x | clerk | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -186,13 +186,17 @@ updateCache () { # | gawk -F '\t' '{ printf "%.2s\t%.40s\t%.40s\t%.200s\t%.500s\n", $1, $2, $3, $4, $5, $6 }' \ } -date=$(mpc stats | grep 'DB Updated: ') -file="$HOME/.config/clerk/.lastupdate" -if [ "$(< $file)" = "$date" ] && [ -f "$file" ] ; then +if [[ $1 == "--update" ]]; then : else - updateCache - echo "${date}" > "${file}" + date=$(mpc stats | grep 'DB Updated: ') + file="$HOME/.config/clerk/.lastupdate" + if [ "$(< $file)" = "$date" ] && [ -f "$file" ] ; then + : + else + updateCache + echo "${date}" > "${file}" + fi fi # Use GNU coreutils on OSX |