UnitJS/unit.js.tpl

17 lines
261 B
Smarty
Executable File

#!/bin/bash
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