Skip to content

Instantly share code, notes, and snippets.

@rxw1
Created February 16, 2015 22:29
Show Gist options
  • Save rxw1/b955c8614a94d88a7be5 to your computer and use it in GitHub Desktop.
Save rxw1/b955c8614a94d88a7be5 to your computer and use it in GitHub Desktop.
Create a manifest.appcache file
#!/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