diff options
author | Philip Wittamore <philip@wittamore.com> | 2025-10-09 18:31:39 +0200 |
---|---|---|
committer | Philip Wittamore <philip@wittamore.com> | 2025-10-09 18:31:39 +0200 |
commit | c6a7d51df19e6dc06f2a120c07619980b865d0ce (patch) | |
tree | b5b649f8b9ddece831747e4330f26448014f45d1 | |
parent | f023c7d28624c77712973ad65eb51434b35ce086 (diff) | |
download | scripts-master.tar.gz scripts-master.tar.bz2 scripts-master.zip |
-rwxr-xr-x | phlogthis | 31 |
1 files changed, 20 insertions, 11 deletions
@@ -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." + |