Skip to content

Commit

Permalink
revert: deletion of nil checks hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
avirtopeanu-ionos committed Nov 22, 2023
1 parent d90c973 commit 93c05bd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions comptplus.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ func (co *CobraPrompt) RunContext(ctx context.Context) {
if co.RootCmd == nil {
panic("RootCmd is not set. Please set RootCmd")
}

if co.HookBefore == nil {
co.HookBefore = func(_ string) {}
}

if co.HookAfter == nil {
co.HookAfter = func(_ string) {}
}

co.prepareCommands()

p := prompt.New(
Expand Down

0 comments on commit 93c05bd

Please sign in to comment.