Files
Augusto Mota Pinheiro dd6736eb9f fix(commands): use relative paths in manifest generation (#27)
* fix(commands): use relative paths in manifest generation

* chore(commands): include generated timestamp in manifest

* chore(commands): stop including generated timestamp in manifest
2026-04-28 11:02:26 -04:00

17 lines
594 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
entries='[]'
for f in commands/*.md; do
name=$(awk '/^name:/{print $2; exit}' "$f")
desc=$(sed -n 's/^description: *//p' "$f" | head -1 | sed 's/^["'"'"']//;s/["'"'"']$//')
path="${f#commands/}"
entries=$(echo "$entries" | jq --arg name "$name" --arg path "$path" --arg desc "$desc" \
'. + [{name: $name, path: $path, description: $desc}]')
done
jq -n --argjson commands "$entries" '{commands: $commands}' > commands/manifest.json
echo "Generated commands/manifest.json with $(echo "$entries" | jq length) commands."