add multiple sources for zettel

master
Brian Hicks 2020-05-29 14:24:00 -05:00
parent 74d9673e24
commit a2262aeb6c
2 changed files with 14 additions and 1 deletions

10
bin/zettel-sources Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
CONFIG="${ZETTEL_HOME:-${HOME:-~}/.config/zettel/config.json}"
if test -f "$CONFIG"; then
jq -r 'to_entries | map(.key) | join("\n")' "$CONFIG"
else
echo .
fi

View File

@ -1,3 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail
awk '{ printf "%s:", FILENAME; print; nextfile }' zettel/* | sed -E 's/:# ?/:/g'
zettel-sources \
| xargs -I FILES find FILES -type f -name '*.md' \
| xargs awk '{ printf "%s:", FILENAME; print; nextfile }' \
| sed -E 's/:# ?/:/g'