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

Side by Side Diff: third_party/polymer/v1_0/extract_inline_scripts.sh

Issue 1162963002: Revert "Rename polymer and cr_elements v0_8 to v1_0" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 #!/bin/bash
2
3 # Copyright 2014 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 set -e
8
9 if [ "$#" -ne 2 ]
10 then
11 echo "Usage: $0 <src_dir> <dst_dir>"
12 echo
13 echo "Copies <src_dir> to <dst_dir> and extracts all inline scripts from" \
14 "Polymer HTML files found in the destination directory to separate JS" \
15 "files. A JS file extracted from the file with name 'foo.html' will" \
16 "have a name 'foo-extracted.js'. Inclusion of the script file will be" \
17 "added to 'foo.html': '<script src=\"foo-extracted.js\"></script>'."
18 exit 1
19 fi
20
21 src="$1"
22 dst="$2"
23
24 if [ -e "$dst" ]
25 then
26 echo "ERROR: '$dst' already exists. Please remove it before running the" \
27 "script." 1>&2
28 exit 1
29 fi
30
31 cp -r "$src" "$dst"
32 find "$dst" -name "*.html" \
33 -not -path "*/demos/*" \
34 -not -path "*/test/*" \
35 -not -path "*/tests/*" \
36 -not -name "demo*.html" \
37 -not -name "index.html" \
38 -not -name "metadata.html" | \
39 xargs grep -l "<script>" | \
40 while read original_html_name
41 do
42 dir=$(dirname "$original_html_name")
43 name=$(basename "$original_html_name" .html)
44
45 html_without_js="$dir/$name-extracted.html"
46 extracted_js="$dir/$name-extracted.js"
47 crisper --source "$original_html_name" --html "$html_without_js" --js "$extrac ted_js"
48 mv "$html_without_js" "$original_html_name"
49 done
OLDNEW
« no previous file with comments | « third_party/polymer/v1_0/components/web-animations-js/web-animations.min.js.map ('k') | third_party/polymer/v1_0/reproduce.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698