summaryrefslogtreecommitdiff
path: root/new.sh
diff options
context:
space:
mode:
author53hornet <atc@53hor.net>2021-12-15 15:13:50 -0500
committer53hornet <atc@53hor.net>2021-12-15 15:13:50 -0500
commitc3b77872285c05ed42359434d5c306304b8dfaeb (patch)
tree31b2e2a44f82a85e145abc699aaeb60280f6a0cc /new.sh
parentf954585ea098ee5d6619c62a8fa48a904474ab3f (diff)
download53hor-c3b77872285c05ed42359434d5c306304b8dfaeb.tar.xz
53hor-c3b77872285c05ed42359434d5c306304b8dfaeb.zip
feat: add rescue draft and move new to scripts, add links
Diffstat (limited to 'new.sh')
-rwxr-xr-xnew.sh22
1 files changed, 0 insertions, 22 deletions
diff --git a/new.sh b/new.sh
deleted file mode 100755
index 0664940..0000000
--- a/new.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/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.