diff options
| author | Roman Ilin <me@romanilin.is> | 2026-06-24 14:42:16 +0300 |
|---|---|---|
| committer | Roman Ilin <me@romanilin.is> | 2026-06-24 14:42:16 +0300 |
| commit | 4eafadb1653b215883e555e4cd00cda0caaf5ab4 (patch) | |
| tree | a91f0ba168a5306a74de26157cb290e390bf36d6 /tasks | |
| download | colloid-main.tar.gz | |
Diffstat (limited to 'tasks')
| -rwxr-xr-x | tasks/.create.sh | 24 | ||||
| -rw-r--r-- | tasks/.template.md | 6 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tasks/.create.sh b/tasks/.create.sh new file mode 100755 index 0000000..5329191 --- /dev/null +++ b/tasks/.create.sh @@ -0,0 +1,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" diff --git a/tasks/.template.md b/tasks/.template.md new file mode 100644 index 0000000..1f08652 --- /dev/null +++ b/tasks/.template.md @@ -0,0 +1,6 @@ +title: +created at: +status: created +tags: + + |