File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 1
1
package engine
2
2
3
3
import (
4
- "crypto/md5"
5
- "encoding/hex"
6
4
"path/filepath"
7
5
"regexp"
8
6
"strings"
@@ -21,20 +19,20 @@ func ToolNormalizer(tool string) string {
21
19
if strings .HasSuffix (tool , system .Suffix ) {
22
20
tool = strings .TrimSuffix (tool , filepath .Ext (tool ))
23
21
}
22
+ if strings .HasPrefix (tool , "sys." ) {
23
+ tool = strings .TrimPrefix (tool , "sys." )
24
+ }
24
25
25
26
if validToolName .MatchString (tool ) {
26
27
return tool
27
28
}
28
29
29
- name := invalidChars .ReplaceAllString (tool , "- " )
30
+ name := invalidChars .ReplaceAllString (tool , "_ " )
30
31
if len (name ) > 55 {
31
32
name = name [:55 ]
32
33
}
33
34
34
- hash := md5 .Sum ([]byte (tool ))
35
- hexed := hex .EncodeToString (hash [:])
36
-
37
- return name + "-" + hexed [:8 ]
35
+ return name
38
36
}
39
37
40
38
func PickToolName (toolName string , existing map [string ]struct {}) string {
You can’t perform that action at this time.
0 commit comments