Skip to content

Commit 9f5f93d

Browse files
author
Roberto Sora
committed
add tool entry with version in installed.json
1 parent f289f3b commit 9f5f93d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

v2/pkgs/tools.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,9 @@ func (c *Tools) Remove(ctx context.Context, payload *tools.ToolPayload) (*tools.
212212

213213
func rename(base string) extract.Renamer {
214214
return func(path string) string {
215-
parts := strings.Split(path, string(filepath.Separator))
216-
path = strings.Join(parts[1:], string(filepath.Separator))
215+
parts := strings.Split(filepath.ToSlash(path), "/")
216+
path = strings.Join(parts[1:], "/")
217217
path = filepath.Join(base, path)
218-
219218
return path
220219
}
221220
}
@@ -258,8 +257,9 @@ func writeInstalled(folder, path string) error {
258257

259258
parts := strings.Split(path, string(filepath.Separator))
260259
tool := parts[len(parts)-2]
261-
260+
toolWithVersion := fmt.Sprint(tool, "-", parts[len(parts)-1])
262261
installed[tool] = filepath.Join(folder, path)
262+
installed[toolWithVersion] = filepath.Join(folder, path)
263263

264264
data, err = json.Marshal(installed)
265265
if err != nil {

0 commit comments

Comments
 (0)