File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ replace_libs () { # $1 is $core_version $2 is $jqm_version $3 is $file
4
+
5
+ core_version=" $1 "
6
+ jqm_version=" $2 "
7
+ filename=" $3 "
8
+
9
+ tmpfile=" $( mktemp ) "
10
+
11
+ cat " $filename " | \
12
+ sed -r " s@(//code.jquery.com/jquery-)([0-9]+\.[0-9]+\.[0-9]+)@\1$core_version @g" | \
13
+ sed -r " s@(//code.jquery.com/mobile/)([^/]*)/jquery.mobile-(.*).min@\1$jqm_version /jquery.mobile-$jqm_version .min@g" \
14
+ > " $tmpfile " &&
15
+ mv " $tmpfile " " $filename "
16
+ rm -f " $tmpfile "
17
+ }
18
+
19
+ core_version=" $1 "
20
+ jqm_version=" $2 "
21
+
22
+ if test " x$core_version " = " x" -o " x$jqm_version " = " x" ; then
23
+ echo " Modifies entries2html.xsl and the examples in resources/ with the given version of core and mobile."
24
+ echo " Commit the result if you wish to make the change permanent."
25
+ echo " "
26
+ echo " Usage: $( basename $0 ) <core_version> <jqm_version>"
27
+ exit 1
28
+ fi
29
+
30
+ if ! echo " $core_version " | grep -qE ' ^[0-9]+\.[0-9]+\.[0-9]+$' ; then
31
+ echo " Core version must be of the form xxx.yyy.zzz where xxx, yyy, and zzz are numbers."
32
+ exit 2
33
+ fi
34
+
35
+ find resources -type f | while read ; do
36
+ replace_libs " $core_version " " $jqm_version " " $REPLY "
37
+ done
38
+ replace_libs " $core_version " " $jqm_version " entries2html.xsl
You can’t perform that action at this time.
0 commit comments