summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
authorJoe <rrbo@proton.me>2023-03-02 16:05:46 +0100
committerJoe <rrbo@proton.me>2023-03-02 16:05:46 +0100
commit242f0e777eeeacaf548b0c5e7a20acf5b3a6ac09 (patch)
tree2ec1a2d28cf185a37f9099cd68c402b566b8a238 /.local/bin
parentidea up (diff)
downloaddotfiles-bsd-242f0e777eeeacaf548b0c5e7a20acf5b3a6ac09.tar.gz
dotfiles-bsd-242f0e777eeeacaf548b0c5e7a20acf5b3a6ac09.tar.bz2
dotfiles-bsd-242f0e777eeeacaf548b0c5e7a20acf5b3a6ac09.tar.xz
dotfiles-bsd-242f0e777eeeacaf548b0c5e7a20acf5b3a6ac09.tar.zst
dotfiles-bsd-242f0e777eeeacaf548b0c5e7a20acf5b3a6ac09.zip
up
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/idea11
1 files changed, 6 insertions, 5 deletions
diff --git a/.local/bin/idea b/.local/bin/idea
index fc0f244..c6ffa6d 100755
--- a/.local/bin/idea
+++ b/.local/bin/idea
@@ -8,19 +8,20 @@ else
thought="$*"
fi
-thought="$(echo -n "${thought}" | sed '{s/$/<br>\\/;s/^/\\t\\t\\t\\t\\t/;};${s/<br>\\$/\\/;p;x;};1d')"
-date=$(date '+%a, %d %b %Y %T')
-html_fmt='\t\t\t\t<h3>'"${date}"'<\/h3>\
+thought="$(printf "%s" "${thought}" | sed '{s#^#\\t\\t\\t\\t\\t#;s#^\\t\\t\\t\\t\\t$#\\t\\t\\t\\t</p>\\\n\\t\\t\\t\\t<p>#;s#$#\\#;}')"
+# thought="$(echo -n "${thought}" | sed '{s/$$/<\/p>\n<p>/;s/$/\\/;s/^/\\t\\t\\t\\t\\t/;};${s/<br>\\$/\\/;p;x;};1d')"
+date=$(date '+%a, %d %b %Y %H:%M')
+html_fmt='\t\t\t\t<h3>'"${date}"'</h3>\
\t\t\t\t<p>\
'"${thought}"'
-\t\t\t\t<\/p>\
+\t\t\t\t</p>\
'
case $(hostname -s) in
mother|po-rbo) sed="sed -i" ;;
fbsd-tp) sed="sed -i ''" ;;
esac
-$sed -e '/<!-- thoughts here -->$/{n;s/^/'"${html_fmt}"'/;}' \
+$sed -e '/<!-- thoughts here -->$/{n;s#^#'"${html_fmt}"'#;}' \
"$HOME"/dev/web/joe-www/thoughts.html
git -C "$HOME"/dev/web/joe-www add -u
git -C "$HOME"/dev/web/joe-www commit -m "Thought: ${date}"