diff options
| author | Philip Wittamore <philip@wittamore.com> | 2025-11-08 17:52:58 +0100 |
|---|---|---|
| committer | Philip Wittamore <philip@wittamore.com> | 2025-11-08 17:52:58 +0100 |
| commit | 5637b6bc9e9ca99779fd6483318f33a6fe38152d (patch) | |
| tree | e7c7f5556be89e8f11ded44ca167a473032bcdfe /phlogthis | |
| parent | 301c765535e2dc4e51a3b756e2b830dbe51293aa (diff) | |
| download | scripts-master.tar.gz scripts-master.tar.bz2 scripts-master.zip | |
Diffstat (limited to 'phlogthis')
| -rwxr-xr-x | phlogthis | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -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 |
