Skip to content

Instantly share code, notes, and snippets.

@blikenoother
Created August 12, 2018 07:38
Show Gist options
  • Save blikenoother/d17c2928bdf51e51290ea64cdf4640d4 to your computer and use it in GitHub Desktop.
Save blikenoother/d17c2928bdf51e51290ea64cdf4640d4 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
OLDIFS=$IFS
IFS=$'\n'
for FILE in $(find public -type f -iname '*.css' -o -iname '*.js' -o -iname '*.svg' -o -iname '*.json'); do
echo -n "Compressing ${FILE}..."
brotli --input ${FILE} --force --output ${FILE}.br;
echo "done."
done
IFS=$OLDIFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment