1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-03-18 21:57:50 +02:00

bind hooksWatch flag

This commit is contained in:
Gani Georgiev 2023-06-21 21:46:13 +03:00
parent c795ecd21e
commit dad289b90d

View File

@ -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