bind hooksWatch flag
This commit is contained in:
@@ -30,6 +30,14 @@ func main() {
|
|||||||
"the directory with the JS app hooks",
|
"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
|
var migrationsDir string
|
||||||
app.RootCmd.PersistentFlags().StringVar(
|
app.RootCmd.PersistentFlags().StringVar(
|
||||||
&migrationsDir,
|
&migrationsDir,
|
||||||
@@ -79,6 +87,7 @@ func main() {
|
|||||||
// load js pb_hooks
|
// load js pb_hooks
|
||||||
jsvm.MustRegisterHooks(app, jsvm.HooksConfig{
|
jsvm.MustRegisterHooks(app, jsvm.HooksConfig{
|
||||||
Dir: hooksDir,
|
Dir: hooksDir,
|
||||||
|
Watch: hooksWatch,
|
||||||
})
|
})
|
||||||
|
|
||||||
// load js pb_migrations
|
// load js pb_migrations
|
||||||
|
|||||||
Reference in New Issue
Block a user