Skip to content

Instantly share code, notes, and snippets.

@belen-albeza
Forked from arcturus/appcache.sh
Created September 19, 2012 09:23
Show Gist options
  • Save belen-albeza/3748667 to your computer and use it in GitHub Desktop.
Save belen-albeza/3748667 to your computer and use it in GitHub Desktop.
Simple bash script to generate .appcache file from your web app
#!/bin/bash
echo "CACHE MANIFEST"
echo "#Generated: $(date)"
echo "CACHE:"
echo "/"
find . \( ! -regex '.*/\..*' \) -type f |
while read i; do
if [ "${i:2}" != '$("basename $0")' ]; then
if [[ $i == \./* ]]; then
echo "/${i:2}"
else
echo "/${i}"
fi
fi
done
echo "NETWORK:"
echo "*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment