about summary refs log tree commit diff stats
path: root/modules/by-name/ts/tskm/taskwarrior_hooks/enforce-projects.sh
blob: d65f786a2c670c5e29583e8cec9a936d7fc62474 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env sh

new_task="$1"

project="$(echo "$new_task" | jq '.project' --raw-output)"
[ "$project" = "null" ] && die "No project supplied!"

if ! neorg list | grep -q "^$project$"; then
    die "The project '$project' is not (yet) registered, registered projects: $(neorg list | tr '\n' ',')"
fi

# vim: ft=sh