UnitJS/unit.js.tpl

16 lines
259 B
Smarty
Executable file

#!/bin/sh
indent()
{
local tabs="$(printf '\t%.0s' `seq 1 $1`)"
sed "s|^|${tabs}|"
}
cat <<EOF
var unitJS = (function() {
return {
$(echo "${@}" | sed -e 's| |,\n|g' -e 's|\([^.\n]\+\)\.js|\u\1: \u\1|g' | indent 2)
};
$(cat "${@}" | indent 1)
})();
EOF