Skip to content

Commit

Permalink
fix after-clone-hook
Browse files Browse the repository at this point in the history
  • Loading branch information
MadridianFox committed Sep 26, 2022
1 parent 0b2c979 commit 5019746
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,11 @@ func (comp *Component) getAfterCloneHook() string {
return comp.Config.AfterCloneHook
}

return comp.Template.AfterCloneHook
if comp.Template != nil {
return comp.Template.AfterCloneHook
}

return ""
}

func (comp *Component) Clone(options *GlobalOptions, noHook bool) error {
Expand All @@ -344,6 +348,10 @@ func (comp *Component) Clone(options *GlobalOptions, noHook bool) error {

if !noHook {
afterCloneHook := comp.getAfterCloneHook()
if afterCloneHook == "" {
return nil
}

afterCloneHook, err = comp.Context.RenderString(afterCloneHook)
if err != nil {
return err
Expand Down

0 comments on commit 5019746

Please sign in to comment.