Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c29ffd7

Browse files
committedFeb 15, 2017
make vanilla support lemplate tmplate engine
1 parent c1f3431 commit c29ffd7

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed
 

‎configure

+1
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ _EOC_
316316
close $out;
317317
chmod 0755, "vanilla/$rs_bin_name";
318318
}
319+
shell "cp -p vanilla/bin/lemplate ./vanilla/lemplate-$vanilla_version";
319320
}
320321

321322
sub gen_makefile {

‎vanilla/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ install: all
2020
$(INSTALL) ./spec $(VANILLA_LIB_DIR)/vanilla
2121
$(INSTALL) ./vanilla-$(VANILLA_VERSION) $(VANILLA_BIN_PATH)/vanilla-$(VANILLA_VERSION)
2222
$(INSTALL) ./v-console-$(VANILLA_VERSION) $(VANILLA_BIN_PATH)/v-console-$(VANILLA_VERSION)
23+
$(INSTALL) ./lemplate-$(VANILLA_VERSION) $(VANILLA_BIN_PATH)/lemplate-$(VANILLA_VERSION)
2324

2425
test: all
2526
PATH=$(OPENRESTY_PREFIX)/nginx/sbin:$$PATH prove -I../test-nginx/lib -r t

‎vanilla/sys/application.lua

+6
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,11 @@ case "$1" in
906906
die "Config Test Fail."
907907
fi
908908
;;
909+
ltpl)
910+
echo $ECHO_E"Start using lemplate compile TT2 template ..."
911+
TT2_TEMPLATE_PATH=$VA_APP_PATH/application/views/
912+
lemplate-{{VANILLA_VERSION}} --compile $TT2_TEMPLATE_PATH/*.html > $TT2_TEMPLATE_PATH/templates.lua
913+
;;
909914
*)
910915
echo $ECHO_E"Usage: ./va-ok-service {start|stop|restart|reload|force-reload|confinit[-f]|configtest} [dev]" >&2
911916
exit 1
@@ -1195,6 +1200,7 @@ function VaApplication.new(app_path)
11951200

11961201
service_manage_sh = sgsub(service_manage_sh, "{{APP_NAME}}", app_name)
11971202
service_manage_sh = sgsub(service_manage_sh, "{{OPENRESTY_NGINX_ROOT}}", VANILLA_NGX_PATH)
1203+
service_manage_sh = sgsub(service_manage_sh, "{{VANILLA_VERSION}}", VANILLA_VERSION)
11981204
VaApplication.files['va-' .. app_name .. '-service'] = sgsub(service_manage_sh, "{{VA_APP_PATH}}", app_path)
11991205

12001206
dev_nginx_vhost_config_tpl = sgsub(dev_nginx_vhost_config_tpl, "{{APP_NAME}}", app_name)

0 commit comments

Comments
 (0)
Please sign in to comment.