s4

diff s4-blog.sh @ 869:b2bb87a9b8a1

Supply main-db path on invocation from commandline
author HIROSE Yuuji <yuuji@gentei.org>
date Thu, 10 Sep 2020 12:11:37 +0859
parents a2e2bf4ee7eb
children 380167e9cfcf
line diff
     1.1 --- a/s4-blog.sh	Sun Sep 06 11:24:28 2020 +0859
     1.2 +++ b/s4-blog.sh	Thu Sep 10 12:11:37 2020 +0859
     1.3 @@ -894,9 +894,9 @@
     1.4        dir=`printf $bd/%d/%06d "$rid" "$rowid"`
     1.5      fi
     1.6      txt=`printf %06d $rowid`.txt
     1.7 -    mkdir -p $dir
     1.8 -    echo "$author" > $dir/Author
     1.9 -    echo "$text" | unhexize > $dir/$txt
    1.10 +    test -d "$dir" || mkdir -p "$dir"
    1.11 +    echo "$author" > "$dir"/Author.txt
    1.12 +    echo "$text" | unhexize > "$dir/$txt"
    1.13      i=0
    1.14      query "SELECT m.rowid, m.val FROM article_m m \
    1.15  	   WHERE id='$artid' AND m.key IN ('image', 'document', 'binary');" \