@@ -6,24 +6,32 @@ import (
66)
77
88// isILogicCondition checks if the condition is an "AND" or an "OR" condition
9- func isLogicCondition (action string ) bool {
10- return strings .HasPrefix (strings .ToLower (action ), "captainhook::logic" )
9+ func isLogicCondition (exec string ) bool {
10+ return strings .HasPrefix (strings .ToLower (exec ), "captainhook::logic" ) ||
11+ strings .HasPrefix (strings .ToLower (exec ), "captainhook.logic" )
1112}
1213
1314// isInternalFunctionality answers if an action should trigger internal CaptainHook functionality
14- func isInternalFunctionality (action string ) bool {
15- return strings .HasPrefix (strings .ToLower (action ), "captainhook::" )
15+ func isInternalFunctionality (exec string ) bool {
16+ return strings .HasPrefix (strings .ToLower (exec ), "captainhook::" ) ||
17+ strings .HasPrefix (strings .ToLower (exec ), "captainhook." )
1618}
1719
1820// splitInternalPath is determining the internal functionality to call
1921// Internal paths consist of two blocks separated by .
2022//
2123// Examples:
2224// - CaptainHook::SOME.FUNCTIONALITY
23- // - CaptainHook::Branch.EnsureNaming
24- func splitInternalPath (action string ) []string {
25- actionPath := strings .Split (action , "::" )[1 ]
26- return strings .Split (actionPath , "." )
25+ // - CaptainHook.Branch.EnsureNaming
26+ func splitInternalPath (exec string ) []string {
27+ var prefix string
28+ if strings .HasPrefix (strings .ToLower (exec ), "captainhook::" ) {
29+ prefix = "captainhook::"
30+ } else {
31+ prefix = "captainhook."
32+ }
33+ pathInfo := strings .Replace (strings .ToLower (exec ), prefix , "" , 1 )
34+ return strings .Split (pathInfo , "." )
2735}
2836
2937// isSymlink checks if a file is a symlink
0 commit comments