#!/bin/bash # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. set -e if [ "$#" -ne 2 ] then echo "Usage: $0 " echo echo "Copies to and extracts all inline scripts from" \ "Polymer HTML files found in the destination directory to separate JS" \ "files. A JS file extracted from the file with name 'foo.html' will" \ "have a name 'foo-extracted.js'. Inclusion of the script file will be" \ "added to 'foo.html': ''." exit 1 fi src="$1" dst="$2" if [ -e "$dst" ] then echo "ERROR: '$dst' already exists. Please remove it before running the" \ "script." 1>&2 exit 1 fi cp -r "$src" "$dst" find "$dst" -name "*.html" \ -not -path "*/demos/*" \ -not -path "*/test/*" \ -not -path "*/tests/*" \ -not -name "demo*.html" \ -not -name "index.html" \ -not -name "metadata.html" | \ xargs grep -l "