diff --git a/build_public.sh b/build_public.sh new file mode 100644 index 0000000..9ced87d --- /dev/null +++ b/build_public.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +# Include private +. var.sh + +# Removing unnecessary attribute quotes (only for end user release not for dev release) +find $ROOT_PATH -name "*tpl.php" | xargs -L1 sed -i -e 's/(name=")([a-zA-Z0-9\-\_]*)(")/name=\2/g' +find $ROOT_PATH -name "*tpl.php" | xargs -L1 sed -i -e 's/(for=")([a-zA-Z0-9\-\_]*)(")/for=\2/g' +find $ROOT_PATH -name "*tpl.php" | xargs -L1 sed -i -e 's/(id=")([a-zA-Z0-9\-\_]*)(")/id=\2/g' +find $ROOT_PATH -name "*tpl.php" | xargs -L1 sed -i -e 's/(class=")([a-zA-Z0-9\-\_]*)(")/class=\2/g' +find $ROOT_PATH -name "*tpl.php" | xargs -L1 sed -i -e 's/(min=")([a-zA-Z0-9\-\_]*)(")/min=\2/g' +find $ROOT_PATH -name "*tpl.php" | xargs -L1 sed -i -e 's/(min=")([a-zA-Z0-9\-\_]*)(")/min=\2/g' +find $ROOT_PATH -name "*tpl.php" | xargs -L1 sed -i -e 's/(max=")([a-zA-Z0-9\-\_]*)(")/max=\2/g' +find $ROOT_PATH -name "*tpl.php" | xargs -L1 sed -i -e 's/(type=")([a-zA-Z0-9\-\_]*)(")/type=\2/g' +find $ROOT_PATH -name "*tpl.php" | xargs -L1 sed -i -e 's/(role=")([a-zA-Z0-9\-\_]*)(")/role=\2/g' +find $ROOT_PATH -name "*tpl.php" | xargs -L1 sed -i -e 's/(method=")(.*)(")/method=\2/g' +find $ROOT_PATH -name "*tpl.php" | xargs -L1 sed -i -e 's/(action=")(.*)(")/action=\2/g' +find $ROOT_PATH -name "*tpl.php" | xargs -L1 sed -i -e 's/(href=")(.*)(")/href=\2/g' + +# Removing unnecessary whitespace +find $ROOT_PATH -name "*tpl.php" | xargs -L1 sed -i -e 's/ */ /g' + +# Removing unnecessary newline +find $ROOT_PATH -name "*tpl.php" | xargs -L1 sed -i -e ':a;N;$!ba;s/\n/ /g' + +# Removing comments +find $ROOT_PATH -name "*tpl.php" | sed -e :a -re 's///g;/