Skip to content

Commit

Permalink
bind hooksWatch flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ganigeorgiev committed Jun 21, 2023
1 parent c795ecd commit dad289b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion examples/base/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dad289b

Please sign in to comment.