From 70b548923993fd599cd538c8eace6e6dfe2bdd56 Mon Sep 17 00:00:00 2001 From: Rasmus Steinke Date: Mon, 25 Aug 2014 00:54:07 +0200 Subject: fixed errors --- clerk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'clerk') diff --git a/clerk b/clerk index 3b8578f..ae998db 100644 --- a/clerk +++ b/clerk @@ -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" -- cgit v1.2.3-24-g4f1b