From e0e45f0697ea0858fbea34cffc824f80105e8d7f Mon Sep 17 00:00:00 2001 From: 53hornet Date: Sat, 2 Oct 2021 11:59:08 -0400 Subject: published hudson fan shroud, replaced makefile with scripts, added some drafts --- new.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 new.sh (limited to 'new.sh') diff --git a/new.sh b/new.sh new file mode 100755 index 0000000..0664940 --- /dev/null +++ b/new.sh @@ -0,0 +1,22 @@ +#!/bin/sh +read -rp 'Title: ' title +draft=drafts/$(date +'%Y-%m-%d')-$(printf "$title" | tr -Cs '[:alnum:]' '-' | tr '[:upper:]' '[:lower:]').php + +cat > "$draft" << EOF + + +EOF + +$EDITOR "$draft" + +read -rp 'Publish? [y/N]: ' choice +[ 'y' = "$choice" ] && mv "$draft" posts/ || echo Saved draft. + +read -rp 'Go live? [y/N]: ' choice +[ 'y' = "$choice" ] && git commit && git push origin && git push live || echo Deferred publish. -- cgit v1.2.3