Skip to content

Commit

Permalink
Merge pull request Knockout-Contrib#177 from lhope/unix-build
Browse files Browse the repository at this point in the history
Fixes to unix build.sh so it is compatible with new KoGrid 2.0 build
  • Loading branch information
jonricaurte committed Jan 10, 2013
2 parents c43d2e4 + 5bee6fa commit 3f65ee3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build/build-order.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
..\src\classes\searchProvider.js
..\src\classes\selectionService.js
..\src\classes\styleProvider.js
..\src\classes\SortService.js
..\src\classes\DomUtilityService.js
..\src\classes\sortService.js
..\src\classes\domUtilityService.js
23 changes: 17 additions & 6 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,23 @@ cat $BuildOrder | sed 's/\\/\//g' |
while read A
do
# Wrap each file output in a new line
echo >>$OutPutFile.temp
echo "Building... $A"
echo >>$OutPutFile.temp
echo "/***********************************************" >> $OutPutFile.temp
echo "* FILE: $A" >> $OutPutFile.temp
echo "* FILE: $A" | sed 's/\//\\/g' >> $OutPutFile.temp
echo "***********************************************/" >> $OutPutFile.temp
# eliminate unicode Byte Order Mark
sed '1 s/^\xef\xbb\xbf//' "$CurrentDir/$A" >> $OutPutFile.temp
echo >>$OutPutFile.temp
if sed -n -e '/^<!--/q 0' -e 'q 1' "$CurrentDir/$A"
then # html files
sed -e '1 s/^\xef\xbb\xbf//' \
-e "1 s/<\!--\(.*\)-->/\1 = function(){ return '/" \
-e "1! s/'/\\\\'/g" \
-e "1! s/^\s*\(.*\)\s*$/\1/" \
"$CurrentDir/$A" | tr -d '\n' >> $OutPutFile.temp
echo "';};" >> $OutPutFile.temp
else # js files.
sed -e '1 s/^\xef\xbb\xbf//' -e '/^\/\/\//d' "$CurrentDir/$A" >> $OutPutFile.temp
echo >>$OutPutFile.temp
fi
done

# Remove the OutputFile if it exists
Expand All @@ -31,7 +39,10 @@ echo "* Authors: https://github.com/ericmbarnard/koGrid/blob/master/README.md" >
echo "* License: MIT (http://www.opensource.org/licenses/mit-license.php)" >> $OutPutFile
echo "* Compiled At: $(date)" >> $OutPutFile
echo "***********************************************/" >> $OutPutFile
echo "(function(window, undefined){" >> $OutPutFile
echo >> $OutPutFile
echo "(function (window) {" >> $OutPutFile
echo "'use strict';" >> $OutPutFile

cat $OutPutFile.temp >> $OutPutFile
echo "}(window));" >> $OutPutFile
rm $OutPutFile.temp
Expand Down

0 comments on commit 3f65ee3

Please sign in to comment.