diff options
author | Rasmus Steinke <rasi@xssn.at> | 2014-08-25 00:54:07 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2014-08-25 00:54:07 +0200 |
commit | 70b548923993fd599cd538c8eace6e6dfe2bdd56 (patch) | |
tree | 4d06884a28700e838dc51ae1ac2807aeb3449c7f /clerk | |
parent | c5ad2db24d1e84c83243f37f31f4d9494484c30f (diff) | |
download | perl-app-clerk-70b548923993fd599cd538c8eace6e6dfe2bdd56.tar.gz perl-app-clerk-70b548923993fd599cd538c8eace6e6dfe2bdd56.tar.xz |
fixed errors
Diffstat (limited to 'clerk')
-rw-r--r-- | clerk | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -2,6 +2,11 @@ shopt -s globstar source $HOME/.config/clerk/config +if [[ -a "$HOME/.config/clerk/ratings" ]]; then + echo "ratings folder exists. using" +else + mkdir "$HOME/.config/clerk/ratings" +fi # create cached album list new_db="$(mpc stats | grep Updated | sed 's/ //g')" @@ -677,7 +682,7 @@ rateAlbum () { exit else cd $HOME/.config/clerk/ratings - if ls "$(mpc current -f %artist%--%date%--%album%).ratings"; then + if [[ -a "$(mpc current -f %artist%--%date%--%album%).ratings" ]]; then echo "Ratings file present, using it" else echo "artist="$(mpc current --format %artist%)"" >> "$(mpc current -f %artist%--%date%--%album%).ratings" @@ -710,7 +715,7 @@ rateTrack () { cur_artist="$(mpc current -f %artist%)" cur_file="$(basename "$(mpc current -f %file%)")" cd $HOME/.config/clerk/ratings - if ls "$(mpc current -f %artist%--%date%--%album%).ratings"; then + if [[ -a "$(mpc current -f %artist%--%date%--%album%).ratings" ]]; then echo "Ratings file present, using it" else echo "artist="$(mpc current --format %artist%)"" >> "$(mpc current -f %artist%--%date%--%album%).ratings" |