zors icon indicating copy to clipboard operation
zors copied to clipboard

feat(core): Support command hooks

Open sidwebworks opened this issue 3 years ago • 2 comments

Would be cool to to .addHook on a command to intercept its lifecycle and maybe do some modifications at runtime.

command.addHook("pre", (args, options, tools) => {
  console.log("This command is about to run with: ", args, options)
})

command.addHook("post", (args, options, tools) => {
  console.log("This command just finished running with: ", args, options)
})

sidwebworks avatar Jul 04 '22 11:07 sidwebworks

@nexxeln what do u think? can be used for stuff like validation and pre checks

sidwebworks avatar Jul 04 '22 11:07 sidwebworks

Yeah this is nice

nexxeln avatar Jul 04 '22 12:07 nexxeln