@@ -39,32 +39,32 @@ mv tmp/demos/docs/examples/redirect/index.php tmp/demos/docs/examples/redirect/i
3939
4040function inline {
4141 for file in $1 ; do
42- file_dir=$( echo $file | sed " s/\/[^\/]*.html$/\//" )
42+ file_dir=$( echo $file | sed " s/\/[^\/]*.html$/\//" )
4343
44- # remove the php leaving only a list of relative html file paths
45- includes=$( grep -h " \?php include(" $file | sed " s/<?php include( '//" | sed " s/' ); ?>//g" | sed " s/\s*//" )
44+ # remove the php leaving only a list of relative html file paths
45+ includes=$( grep -h " \?php include(" $file | sed " s/<?php include( '//" | sed " s/' ); ?>//g" | sed " s/\s*//" )
4646
47- # for each relative path resolve it and replac the corresponding php
48- # include in the file with the resolved files contents
49- for include_relative in $includes ; do
50- # the html extension file include
51- html_include=$( echo $include_relative | sed " s/.php/.html/" )
47+ # for each relative path resolve it and replac the corresponding php
48+ # include in the file with the resolved files contents
49+ for include_relative in $includes ; do
50+ # the html extension file include
51+ html_include=$( echo $include_relative | sed " s/.php/.html/" )
5252
53- # the fully resolved path, NOTE readlink should be standard
54- full_file_path=$( readlink -m $file_dir$html_include )
53+ # the fully resolved path, NOTE readlink should be standard
54+ full_file_path=$( readlink -m $file_dir$html_include )
5555
56- # construct the include script replace, removing the path delimiters
57- # and the double dot refs to prevent sed from borking
58- include_string=" <?php include( '.*$( echo $include_relative | sed " s@\([a-zA-Z\-\0-9.]*/\)*@@g" ) ' ); ?>"
56+ # construct the include script replace, removing the path delimiters
57+ # and the double dot refs to prevent sed from borking
58+ include_string=" <?php include( '.*$( echo $include_relative | sed " s@\([a-zA-Z\-\0-9.]*/\)*@@g" ) ' ); ?>"
5959
60- # replace the include string with the resolved file contents
60+ # replace the include string with the resolved file contents
6161 sed -i$SED_INPLACE_EXT " /$include_string /{
6262 s/$include_string //g
6363 r $full_file_path
6464 }" $file
6565
6666 find tmp/demos -name " *$SED_INPLACE_EXT " -exec rm {} \;
67- done
67+ done
6868 done
6969}
7070
0 commit comments