Makefile

on Tumeo Space Journal

Makefile I use to upload posts.
#en #make #tools #scripts

Makefile

 1f ?= ./*.md
 2key := ~/.ssh/id_ed25519 # Your key here
 3POST_CMD = scp -i ${key} ${f} prose.sh:
 4
 5post:
 6	$(POST_CMD)
 7
 8ifneq "${f}" "./*.md" # Prevents deleting all posts at once
 9delete:
10	cat /dev/null | tee ${f}
11	$(POST_CMD)
12endif
13
14.PHONY: post delete

Usage

To (re)upload all posts:

1make

To (re)upload specific posts:

1make f+=post01.md f+=post02.md

To delete specific posts:

1make delete f+=post01.md f+=post02.md

GitHub comments: https://github.com/williamd1k0/prose-posts/issues/3