2011-11-24 15:05:22 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2011-12-03 10:52:36 +01:00
|
|
|
echo ""
|
|
|
|
echo " DataTables build"
|
|
|
|
echo ""
|
|
|
|
|
2011-12-03 10:51:18 +01:00
|
|
|
cd ../media/src
|
2011-11-24 15:05:22 +01:00
|
|
|
|
|
|
|
cp DataTables.js DataTables.js.build
|
|
|
|
|
|
|
|
IFS='%'
|
|
|
|
|
2011-12-03 10:52:36 +01:00
|
|
|
echo " Importing files:"
|
2011-11-24 15:05:22 +01:00
|
|
|
grep "require(" DataTables.js.build > /dev/null
|
|
|
|
while [ $? -eq 0 ]; do
|
|
|
|
REQUIRE=$(grep "require(" DataTables.js.build | head -n 1)
|
|
|
|
|
|
|
|
SPACER=$(echo ${REQUIRE} | cut -d r -f 1)
|
|
|
|
FILE=$(echo ${REQUIRE} | sed -e "s#^.*require('##g" -e "s#');##")
|
|
|
|
DIR=$(echo ${FILE} | cut -d \. -f 1)
|
|
|
|
|
2011-12-03 10:52:36 +01:00
|
|
|
echo " $FILE"
|
2011-11-24 15:05:22 +01:00
|
|
|
|
|
|
|
sed "s#^#${SPACER}#" < ${DIR}/${FILE} > ${DIR}/${FILE}.build
|
|
|
|
|
|
|
|
sed -e "/${REQUIRE}/r ${DIR}/${FILE}.build" -e "/${REQUIRE}/d" < DataTables.js.build > DataTables.js.out
|
|
|
|
mv DataTables.js.out DataTables.js.build
|
|
|
|
|
|
|
|
rm ${DIR}/${FILE}.build
|
|
|
|
|
|
|
|
grep "require(" DataTables.js.build > /dev/null
|
|
|
|
done
|
|
|
|
|
|
|
|
mv DataTables.js.build ../js/jquery.dataTables.js
|