add contents to databases

This commit is contained in:
Malin Freeborn 2025-02-13 00:08:34 +01:00
parent d2934bf8a3
commit b4683a8681
Signed by: andonome
GPG Key ID: 52295D2377F4D70F

View File

@ -4,6 +4,8 @@ EDITOR ?= vi
FZF != command -v sk || command -v fzy || command -v fzf || \
{ echo install a fuzzy finder && exit 1 ;}
spill_contents = sed -e '1,/---/d'
help: ## Print the help message
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \
sort | \
@ -29,6 +31,7 @@ $(databases): .dbs/%.rec: %/ | .dbs/
done > $@
for entry in $(shell find $< -type f -name "*.md"); do \
recset $@ -e "file = '$${entry}'" -f wordcount --set-add="$$(wc -w < $${entry})" ;\
recset $@ -e "file = '$${entry}'" -f contents --set-add="$$($(spill_contents) $${entry})" ;\
done
db.rec: $(databases)