#!/bin/sh fromDir="$HOME/Documents/org-roam/" toDir="$HOME/devel/personal/Ryankes.eu/wiki" date=$(date) rm -rf "$toDir"/wiki/* grep -ril "^\#+select_tags:[\ a-zA-Z0-9]namepage" "$fromDir"*.org | while read -r line; do baseName="$(basename "$line")" markdownFilename="$(echo "$baseName" | cut -f 1 -d '.').md" pandoc "$line" --filter convertLinks.py -t markdown_mmd+yaml_metadata_block -o "$toDir/wiki/$markdownFilename" -s echo "Exporting $baseName to $markdownFilename" done git -C "$toDir" add . git -C "$toDir" commit -m "Update $date" git -C "$toDir" push origin master