Put this in your ~/.zshrc
. Be sure to have your API token in IMGIX_API_TOKEN
;
export IMGIX_API_TOKEN=yourtokenhere
purge() {
URL=$1
echo "Purging ${URL}"
curl -X POST 'https://api.imgix.com/api/v1/purge' \
--header 'Authorization: Bearer $BEARER' \
--header 'Content-Type: application/vnd.api+json' -d "{
\"data\": {
\"attributes\": {
\"url\": \"${URL}\"
},
\"type\": \"purges\"
}
}"
}