-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepfiles
executable file
·44 lines (38 loc) · 1.37 KB
/
prepfiles
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
stripdebug='/^[ ]*\/\/ DEBUG_START/,/^[ ]*\/\/ DEBUG_END/ d'
stripcomments='/^[ ]*\/\// d'
sed -e "$tripdebug;$stripcomments"'
/Cut [BE][A-Z]* for .*\.inc/ d' <annotated.html >index_inlined.html
sed -e "$tripdebug;$stripcomments"'
s/^\(.* Cut BEGIN for \(.*\)\.inc\)/'\
' <script src="node_modules\/lockandload\/\2.js"><\/script>\
\1/g' <annotated.html |
sed -e '/ Cut BEGIN for .*master\.inc/,/ Cut END for .*master\.inc/ d
/ Cut BEGIN for .*headready\.inc/,/ Cut END for .*trailer\.inc/ d' \
>index_extern.html
sed -e "$tripdebug;$stripcomments"'
s/^\(.* Cut BEGIN for \(.*\.inc\)\)/'\
' <?php include("node_modules\/lockandload\/\2"); ?>\
\1/g' <annotated.html |
sed -e '/ Cut BEGIN for .*\.inc/,/ Cut END for .*\.inc/ d' >index.php
carveinc()
{ sed -e "$1$stripcomments
1,/BEGIN for lockandload_$2/ d
/END for lockandload_$2/,\$ d" <annotated.html >lockandload_$2$3.inc
}
carvejs()
{ sed -e "$1$stripcomments
1,/BEGIN for lockandload_$2/ d
/^ <\/*script>$/ d
s/^ <script>/ /
/END for lockandload_$3/,\$ d
/Cut [A-Z]* for lockandload_/ d
" <annotated.html >lockandload_$2$4.js
}
carveinc "" master _debug
carveinc "$stripdebug;" master
carveinc "$stripdebug;" headready
carveinc "$stripdebug;" trailer
carvejs "" master master _debug
carvejs "$stripdebug;" master master
carvejs "$stripdebug;" headready trailer