Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 27 lines (18 sloc) 569 Bytes
#!/bin/bash
printf "\n📝 write\n"
args=$@
post_file_name_leading_dash=""
for arg in ${args[@]}; do
post_file_name_leading_dash="$post_file_name_leading_dash-$arg"
done
post_file_name="$(date +%Y-%m-%d)$post_file_name_leading_dash.md"
post_full_path="posts/$post_file_name"
printf "\n> creating $post_full_path"
touch $post_full_path
date="$(date +%Y-%m-%d)"
touch $post_full_path
printf "\n---" >> $post_full_path
printf "\ntitle: $args" >> $post_full_path
printf "\ndate: $date" >> $post_full_path
printf "\n---\n" >> $post_full_path
open $post_full_path