1
0
obsidian-templates/zz_meta/shell/ttrpg/update_session_metadata.sh
2026-01-10 14:30:32 -06:00

32 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
files=Session*.md
for file in ${files[@]}; do
echo "$file"
export realDate=$(grep 'Real World Date' "$file" | cut -d' ' -f5)
yq \
--front-matter="process" \
--inplace \
'
.tags = ["ttrpg/session"] |
.icon = "book-open" |
.title = "Session " + .session_number |
.gm = "Mike" |
.players = ["Jeff", "Brian", "Oz", "Andy", "Oz"] |
.sessionNumber = .session_number |
.summary = .summary // .["aat-event-body"] // "" |
.aliases = ["Session " + .session_number] |
.realDate = strenv(realDate) |
.["fc-calendar"] = "Calendar of Golarion" |
.["fc-display-name"] = "Kingmaker Session " + .session_number |
.["fc-category"] = "Kingmaker" |
.campaigns = ["[[Kingmaker|Kingmaker]]"] |
del(.type) |
del(.timelines) |
del(.["aat-render-enabled"]) |
del(.session_number) |
del(.campaign) |
del(.["aat-event-body"])
' \
"${file}"
done