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 <