FreeMarker CLI supports the transformation of directories
bin/freemarker-cli -t site/template/ # == application.properties ================================================== server.name=localhost server.logs=/var/log/nginx # == nginx-conf ============================================================= server { listen 80; server_name 127.0.0.1; root /usr/share/nginx/www; index index.htm; }
bin/freemarker-cli -t site/template/ -o out; ls -l out total 8 -rw-r--r-- 1 sgoeschl staff 128 May 30 20:02 application.properties drwxr-xr-x 3 sgoeschl staff 96 May 30 20:02 nginx
bin/freemarker-cli -t site/template/ -P NGINX_HOSTNAME=localhost # == application.properties ================================================== server.name=localhost server.logs=/var/log/nginx # == nginx-conf ============================================================= server { listen 80; server_name localhost; root /usr/share/nginx/www; index index.htm; }
export NGINX_PORT=8080 bin/freemarker-cli -t site/template/ -m env:/// # == application.properties ================================================== server.name=localhost server.logs=/var/log/nginx # == nginx-conf ============================================================= server { listen 8080; server_name 127.0.0.1; root /usr/share/nginx/www; index index.htm; }
echo "NGINX_PORT=8080" > nginx.env bin/freemarker-cli -t site/template/ -m nginx.env # == application.properties ================================================== server.name=localhost server.logs=/var/log/nginx # == nginx-conf ============================================================= server { listen 8080; server_name 127.0.0.1; root /usr/share/nginx/www; index index.htm; }
echo '{"NGINX_PORT":"8443","NGINX_HOSTNAME":"localhost"}' > nginx.json bin/freemarker-cli -t site/template/ -m nginx.json # == application.properties ================================================== server.name=localhost server.logs=/var/log/nginx # == nginx-conf ============================================================= server { listen 8443; server_name localhost; root /usr/share/nginx/www; index index.htm; }
export NGINX_CONF='{"NGINX_PORT":"8443","NGINX_HOSTNAME":"localhost"}' echo $NGINX_CONF {"NGINX_PORT":"8443","NGINX_HOSTNAME":"localhost"} bin/freemarker-cli -t site/template/ -m env:///NGINX_CONF#mimetype=application/json # == application.properties ================================================== server.name=localhost server.logs=/var/log/nginx # == nginx-conf ============================================================= server { listen 8443; server_name localhost; root /usr/share/nginx/www; index index.htm; }