@@ -111,9 +111,9 @@ func collectAllToolsFolders(from string) ([]string, error) {
111
111
return folders , i18n .WrapError (err )
112
112
}
113
113
114
- func toolsSliceContains (tools * []* types.Tool , name , version string ) bool {
114
+ func toolsSliceContains (tools * []* types.Tool , name , version string , platform string ) bool {
115
115
for _ , tool := range * tools {
116
- if name == tool .Name && version == tool .Version {
116
+ if name == tool .Name && version == tool .Version && platform == tool . PlatformId {
117
117
return true
118
118
}
119
119
}
@@ -137,7 +137,7 @@ func loadToolsFrom(tools *[]*types.Tool, builtinToolsVersionsFilePath string) er
137
137
rowParts := strings .Split (row , "=" )
138
138
toolName := strings .Split (rowParts [0 ], "." )[1 ]
139
139
toolVersion := rowParts [1 ]
140
- if ! toolsSliceContains (tools , toolName , toolVersion ) {
140
+ if ! toolsSliceContains (tools , toolName , toolVersion , constants . EMPTY_STRING ) {
141
141
* tools = append (* tools , & types.Tool {Name : toolName , Version : toolVersion , Folder : folder })
142
142
}
143
143
}
@@ -175,13 +175,14 @@ func loadToolsFromFolderStructure(tools *[]*types.Tool, folder string) error {
175
175
if err != nil {
176
176
return i18n .WrapError (err )
177
177
}
178
+ _ , toolPlatform := filepath .Split (filepath .Join (folder , ".." ))
178
179
for _ , toolVersion := range toolVersions {
179
180
toolFolder , err := filepath .Abs (filepath .Join (folder , toolName .Name (), toolVersion .Name ()))
180
181
if err != nil {
181
182
return i18n .WrapError (err )
182
183
}
183
- if ! toolsSliceContains (tools , toolName .Name (), toolVersion .Name ()) {
184
- * tools = append (* tools , & types.Tool {Name : toolName .Name (), Version : toolVersion .Name (), Folder : toolFolder })
184
+ if ! toolsSliceContains (tools , toolName .Name (), toolVersion .Name (), toolPlatform ) {
185
+ * tools = append (* tools , & types.Tool {Name : toolName .Name (), Version : toolVersion .Name (), Folder : toolFolder , PlatformId : toolPlatform })
185
186
}
186
187
}
187
188
}
0 commit comments