From dad289b90dcfe81d2667c41a1659b5251aabcc9a Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Wed, 21 Jun 2023 21:46:13 +0300 Subject: [PATCH] bind hooksWatch flag --- examples/base/main.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/base/main.go b/examples/base/main.go index 77e74cc4..7eb4980e 100644 --- a/examples/base/main.go +++ b/examples/base/main.go @@ -30,6 +30,14 @@ func main() { "the directory with the JS app hooks", ) + var hooksWatch bool + app.RootCmd.PersistentFlags().BoolVar( + &hooksWatch, + "hooksWatch", + true, + "auto restart the app on pb_hooks file change", + ) + var migrationsDir string app.RootCmd.PersistentFlags().StringVar( &migrationsDir, @@ -78,7 +86,8 @@ func main() { // load js pb_hooks jsvm.MustRegisterHooks(app, jsvm.HooksConfig{ - Dir: hooksDir, + Dir: hooksDir, + Watch: hooksWatch, }) // load js pb_migrations