Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Script for parsing Google PageSpeed optimized content MANIFEST
# Script for parsing Google PageSpeed optimized content MANIFEST
# Copyright (C) 2016 Tomasz Silpion Gregorczyk - All Rights Reserved
file="MANIFEST"
while IFS= read line
do
#strip file paths
IFS=':' read -r src protocol url <<EOF
$line
EOF
#remove protocol double slash left in url
path=`echo $url | sed 's/\/\///'`
if test -n "$path"; then
mkdir -p -- "${path%/*}" && touch -- "$path"
cp $src $path
fi
done <"$file"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.