From c6a7d51df19e6dc06f2a120c07619980b865d0ce Mon Sep 17 00:00:00 2001 From: Philip Wittamore Date: Thu, 9 Oct 2025 18:31:39 +0200 Subject: update --- phlogthis | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/phlogthis b/phlogthis index e5fc496..51df9dc 100755 --- a/phlogthis +++ b/phlogthis @@ -2,12 +2,16 @@ # create phlog entry # requires the text formating utility 'par' -# editor is micro - -pushd "$(pwd)" || exit +# see https://git.wittamore.com/par/tree +# config root="$HOME/src/gopher/phlog" remoteroot="/srv/gopher/phlog" +editor="micro +1:1" +mkremotedir="ssh spike mkdir" + +# save location +pushd "$(pwd)" || exit mkdir -p "$HOME/.tmp" cd "$HOME/.tmp" || exit @@ -21,13 +25,11 @@ read -rp "Enter title: " title filetitle=$(echo "$title" | sed "s/ /-/g" | sed "s/[^A-Za-z0-9._-]//g") dirname="$filedate-$filetitle" -# make local and remote dirs +# make local dir mkdir "$root/$dirname" -echo "creating remote directory..." -ssh spike mkdir "$remoteroot/$dirname" # edit text -micro +4:1 "$editfile" +eval "$editor $editfile" # Justify article. This may fail if a # non-empty line doesn't contain spaces @@ -43,20 +45,27 @@ rm $editfile clear cat "$dest" -echo " " -read -rp "Do you want to edit this text? : " choix1 +echo "--------------------------" +read -rp "Do you want to correct this text? : " choix1 if [ "$choix1" != "n" ] ; then clear - micro "$dest" + eval "$editor $dest" fi echo "Article saved as $dest" -read -rp "Run phlogmap & phlogrss & gosend? ; " choix2 +echo "--------------------------" +read -rp "Make remote folder, run phlogmap & phlogrss & gosend? ; " choix2 if [ "$choix2" != "n" ] ; then + echo "creating remote directory..." + eval "$mkremotedir $remoteroot/$dirname" phlogmap; phlogrss ; gosend fi +# return popd || exit + +echo "Done." + -- cgit v1.2.3