@@ -111,9 +111,9 @@ func collectAllToolsFolders(from string) ([]string, error) {
111111 return folders , i18n .WrapError (err )
112112}
113113
114- func toolsSliceContains (tools * []* types.Tool , name , version string ) bool {
114+ func toolsSliceContains (tools * []* types.Tool , name , version string , platform string ) bool {
115115 for _ , tool := range * tools {
116- if name == tool .Name && version == tool .Version {
116+ if name == tool .Name && version == tool .Version && platform == tool . PlatformId {
117117 return true
118118 }
119119 }
@@ -137,7 +137,7 @@ func loadToolsFrom(tools *[]*types.Tool, builtinToolsVersionsFilePath string) er
137137 rowParts := strings .Split (row , "=" )
138138 toolName := strings .Split (rowParts [0 ], "." )[1 ]
139139 toolVersion := rowParts [1 ]
140- if ! toolsSliceContains (tools , toolName , toolVersion ) {
140+ if ! toolsSliceContains (tools , toolName , toolVersion , constants . EMPTY_STRING ) {
141141 * tools = append (* tools , & types.Tool {Name : toolName , Version : toolVersion , Folder : folder })
142142 }
143143 }
@@ -175,13 +175,14 @@ func loadToolsFromFolderStructure(tools *[]*types.Tool, folder string) error {
175175 if err != nil {
176176 return i18n .WrapError (err )
177177 }
178+ _ , toolPlatform := filepath .Split (filepath .Join (folder , ".." ))
178179 for _ , toolVersion := range toolVersions {
179180 toolFolder , err := filepath .Abs (filepath .Join (folder , toolName .Name (), toolVersion .Name ()))
180181 if err != nil {
181182 return i18n .WrapError (err )
182183 }
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 })
185186 }
186187 }
187188 }
0 commit comments