| Index: third_party/polymer/v1_0/extract_inline_scripts.sh
|
| diff --git a/third_party/polymer/v1_0/extract_inline_scripts.sh b/third_party/polymer/v1_0/extract_inline_scripts.sh
|
| index e4c891f75638f63b469aee16065981f468508c06..3d106102a08ef052f44be3fcbc6fb3cf83031fc1 100755
|
| --- a/third_party/polymer/v1_0/extract_inline_scripts.sh
|
| +++ b/third_party/polymer/v1_0/extract_inline_scripts.sh
|
| @@ -10,7 +10,7 @@ if [ "$#" -ne 2 ]
|
| then
|
| echo "Usage: $0 <src_dir> <dst_dir>"
|
| echo
|
| - echo "Copies <src_dir> to <dst_dir> and extracts all inline scripts from" \
|
| + echo "Extracts inlined scripts from <src_dir> to <dst_dir>" \
|
| "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" \
|
| @@ -18,17 +18,11 @@ then
|
| exit 1
|
| fi
|
|
|
| -src="$1"
|
| -dst="$2"
|
| +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
|
| +rsync -c -r -v --exclude="compiled_resources*.gyp" "$src/" "$dst/"
|
|
|
| -cp -r "$src" "$dst"
|
| find "$dst" -name "*.html" \
|
| -not -path "*/demos/*" \
|
| -not -path "*/test/*" \
|
| @@ -44,6 +38,7 @@ do
|
|
|
| html_without_js="$dir/$name-extracted.html"
|
| extracted_js="$dir/$name-extracted.js"
|
| + echo "Crisping $original_html_name"
|
| crisper --script-in-head=false --source "$original_html_name" \
|
| --html "$html_without_js" --js "$extracted_js"
|
| mv "$html_without_js" "$original_html_name"
|
|
|