23 lines
576 B
Bash
Executable File
23 lines
576 B
Bash
Executable File
#!/bin/bash
|
|
# description: Mark a plan as in-progress (rename __todo -> __wip)
|
|
# Args: <plan-filename>
|
|
# Output: new filename
|
|
set -euo pipefail
|
|
|
|
OLLIE="${OLLIE:-$HOME/mnt/ollie}"
|
|
PLAN_DIR="$OLLIE/pl"
|
|
|
|
[ $# -eq 1 ] || { echo "usage: plan_start <plan-filename>"; exit 1; }
|
|
|
|
SRC="$PLAN_DIR/$(basename "$1")"
|
|
[ -f "$SRC" ] || { echo "error: plan not found: $(basename "$1")"; exit 1; }
|
|
|
|
case "$SRC" in
|
|
*__todo.md) ;;
|
|
*) echo "error: plan is not tagged __todo: $(basename "$SRC")"; exit 1 ;;
|
|
esac
|
|
|
|
DST="${SRC/__todo.md/__wip.md}"
|
|
mv "$SRC" "$DST"
|
|
echo "$(basename "$DST")"
|