commit e2e1f4fe6ae0fbeb2b9443507d97afd2015dbe58 parent 3a1a061f82e8b9a9dd7b991291277748ea6e4da2 Author: GeaRSiX <gearsix.net> Date: Fri, 18 Sep 2020 14:53:18 +0100 added -e checks; added usage doc note Diffstat:
M | sfeed-read | | | 12 | +++++++++--- |
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/sfeed-read b/sfeed-read @@ -3,6 +3,7 @@ # sfeed-read # author: gearsix # description: sfeed_update; backup outfile; generates outifle; xdg-open outfile; +# usage: "sfeed-read [$ENGINE]"; $ENGINE is optional and sets the sfeed_* engine to use (default is html) engine=sfeed_html sfeed_files=~/.sfeed/feeds @@ -43,12 +44,17 @@ else sfeed_outfile=$sfeed_outfile.html fi +if [ ! -e $sfeed_outdir ]; then + mkdir -pv $sfeed_outdir +fi + echo "updating feed..." sfeed_update -echo "backing up feed..." -rm $sfeed_outfile.yesterday -mv -v $sfeed_outfile $sfeed_outfile.yesterday +if [ -e $sfeed_outfile ]; then + echo "backing up feed..." + mv -fv $sfeed_outfile $sfeed_outfile.yesterday +fi echo "generating $sfeed_outfile..." $engine $sfeed_files/* > $sfeed_outfile$outext