blob: 53291918d812c717d605990e3b5e17b9af48e05d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/usr/bin/env sh
set -e
if [ "${#}" -eq 0 ]; then
echo "Title arguments are required"
exit 1
fi
cd "$(dirname "$(realpath "$0")")"
title="$@"
task_file="$(
printf %s "$title" | \
tr [:upper:] [:lower:] | \
tr [:space:] -
).md"
cp .template.md "$task_file"
sed -i "s/^\(title: \)/\1$title/" "$task_file"
sed -i "s/^\(created at: \)/\1$(date --utc +"%Y-%m-%dT%H:%M:%S")/" "$task_file"
"${EDITOR:-vi}" "$task_file"
|