diff options
author | 53hornet <atc@53hor.net> | 2021-10-02 11:59:08 -0400 |
---|---|---|
committer | 53hornet <atc@53hor.net> | 2021-10-02 11:59:08 -0400 |
commit | e0e45f0697ea0858fbea34cffc824f80105e8d7f (patch) | |
tree | d594946c0afe2a8f1efeba2b21ab22f07ddfb22b /new.sh | |
parent | 70bc00d5ff256e06c1c7d47c2af00d1863f53f6b (diff) | |
download | 53hor-e0e45f0697ea0858fbea34cffc824f80105e8d7f.tar.xz 53hor-e0e45f0697ea0858fbea34cffc824f80105e8d7f.zip |
published hudson fan shroud, replaced makefile with scripts, added some
drafts
Diffstat (limited to 'new.sh')
-rwxr-xr-x | new.sh | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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 +<?php +\$title = "$title"; +if (isset(\$early) && \$early) { +return; +} +include(\$_SERVER['DOCUMENT_ROOT'] . '/includes/head.php'); +?> + +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. |