From 5637b6bc9e9ca99779fd6483318f33a6fe38152d Mon Sep 17 00:00:00 2001 From: Philip Wittamore Date: Sat, 8 Nov 2025 17:52:58 +0100 Subject: update --- phlogthis | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'phlogthis') diff --git a/phlogthis b/phlogthis index e218b3c..8de9302 100755 --- a/phlogthis +++ b/phlogthis @@ -5,10 +5,12 @@ # see https://git.wittamore.com/par/tree # config -root="$HOME/src/gopher/phlog" +root="$HOME/src/gopher/phlog/" remoteroot="/srv/gopher/phlog" editor="micro +1:1" -mkremotedir="ssh spike mkdir" +mkremotedir="ssh spike mkdir -p" +mkdir -p "$root/$(date +%Y)" +eval "$mkremotedir $remoteroot/$(date +%Y)" # save location pushd "$(pwd)" || exit @@ -18,15 +20,15 @@ cd "$HOME/.tmp" || exit editfile="phlogtmp.txt" articledate="$(date -R)" filedate="$(date +%Y-%m-%d-%H-%I)" -article="/tmp/gophermap.tmp" +article="$HOME/.tmp/article.tmp" read -rp "Enter title: " title filetitle=$(echo "$title" | sed "s/ /-/g" | sed "s/[^A-Za-z0-9._-]//g") -dirname="$filedate-$filetitle" +articlename="$filedate-$filetitle.txt" # make local dir -mkdir "$root/$dirname" +#mkdir "$root/$dirname" # edit text eval "$editor $editfile" @@ -38,9 +40,9 @@ cat "$editfile" | par -jw67 > $article || cat "$editfile" > $article header="$title\n$articledate\n+$(printf "%*s" 65 | tr " " "-")+\n\n" sed -i "1s/^/$header/" $article -dest="$root/$dirname/gophermap" +dest="$root/$(date +%Y)/$articlename" mv "$article" "$dest" -echo "\n\n␌" >> "$dest" +echo -e "\n\n␌" >> "$dest" rm $editfile clear @@ -57,11 +59,9 @@ fi echo "Article saved as $dest" echo "--------------------------" -read -rp "Make remote folder, run phlogmap & phlogrss & gosend? ; " choix2 +read -rp "run phlogmap & phlogrss & gosend? ; " choix2 if [ "$choix2" != "n" ] ; then - echo "creating remote directory..." - eval "$mkremotedir $remoteroot/$dirname" phlogmap; phlogrss ; gosend fi -- cgit v1.2.3