Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: third_party/polymer/v1_0/extract_inline_scripts.sh

Issue 1651273002: Polymer: make reproduce.sh re-entrant (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/polymer/v1_0/reproduce.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
« no previous file with comments | « no previous file | third_party/polymer/v1_0/reproduce.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698