#!/usr/bin/env sh #MISE hide=true set -e target="docs/dev/tasks.md" begin_marker="" end_marker="" docs=$(mise generate task-docs) { head="" tail="" found_begin=false found_end=false while IFS= read -r line; do if [ "$line" = "$end_marker" ]; then found_end=true fi if [ "$found_begin" = true ] && [ "$found_end" = false ]; then continue fi if [ "$found_end" = true ]; then tail="$tail$line " else head="$head$line " fi if [ "$line" = "$begin_marker" ]; then found_begin=true fi done <"$target" printf '%s%s\n%s' "$head" "$docs" "$tail" >"$target" }