Created
February 16, 2015 22:29
-
-
Save rxw1/b955c8614a94d88a7be5 to your computer and use it in GitHub Desktop.
Create a manifest.appcache file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# generate build/manifest.appcache | |
client=($(find client -type f)) | |
build=($(find build -type f)) | |
bower=($(grep -Ehor 'lib/.[a-zA-Z0-9/\._-]+' client | grep '\.')) | |
remote=($(grep -Ehor 'http[s]/[a-zA-Z0-9/\._-]+' client)) | |
cached_files=($client $build $bower $remote) | |
cat << EOF > $1/manifest.appcache | |
CACHE MANIFEST | |
# date: $(date +%x\ %X) | |
# version: $(date +%s | md5sum | cut -d- -f1) | |
CACHE: | |
$(print -l $cached_files) | |
NETWORK: | |
http://* | |
https://* | |
* | |
SETTINGS: | |
prefer-online | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment