1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2025-06-16 07:07:37 +02:00
cheatsheets/_support/cf-purge.sh
2017-10-13 03:58:52 +08:00

24 lines
622 B
Bash
Executable File

#!/usr/bin/env bash
# Helper to copy the latest cheatsheets to the clipboard for CloudFlare
# purging. This ensures visitors will see new versions.
(
git log "master@{3 days ago}..HEAD" --pretty="" --name-only \
| grep -E '\.md$' \
| grep -v -E 'CONTRIBUTING|README|Readme' \
| grep -v -E '^_' \
| sort \
| uniq \
| sed 's/\.md$//g'
) \
| sed 's#^#https://devhints.io/#g' \
| xargs echo https://devhints.io/ \
| pbcopy
echo "Copied to clipboard."
echo "Purge it here:"
echo ""
echo " https://www.cloudflare.com/a/caching/devhints.io"
echo ""
echo "Then click 'Purge Individual Files'"