From 3c9fa7fe0cbc6e4b45e611ede9cc4c89328c9889 Mon Sep 17 00:00:00 2001 From: CrimsonTome Date: Mon, 30 Jan 2023 01:48:20 +0000 Subject: [PATCH] chore: add test script for new post scaffolding --- new-post.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 new-post.sh diff --git a/new-post.sh b/new-post.sh new file mode 100755 index 0000000..9ed4602 --- /dev/null +++ b/new-post.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +# if [ "$1" != "-h" ] || [ "$1" != "--help" ]; then + +title="$(echo "$1" | tr '[:upper:]' '[:lower:]')" +description=$2 +date=$(date -u +%Y-%m-%d) + +stripped_spaces=${title// /-} +filename="$(echo "$stripped_spaces" | tr '[:upper:]' '[:lower:]')".md + +touch drafts/$filename +tee -a drafts/$filename <