From bff9df564e570a89042f2d18b55201ddf026cd1a Mon Sep 17 00:00:00 2001 From: Johannes 'fish' Ziemke Date: Mon, 19 Jul 2021 18:39:14 +0200 Subject: [PATCH] Replace / in version by - This fixes #145 --- pkg/git.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/git.go b/pkg/git.go index 6fa8652..afe9cfe 100644 --- a/pkg/git.go +++ b/pkg/git.go @@ -182,7 +182,7 @@ func remoteResolveRef(ctx context.Context, remote string, ref string) (string, e func (p *GitPackage) Install(ctx context.Context, name, dir, version string) (string, error) { destPath := path.Join(dir, name) - pkgh := sha256.Sum256([]byte(fmt.Sprintf("jsonnetpkg-%s-%s", strings.Replace(name, "/", "-", -1), version))) + pkgh := sha256.Sum256([]byte(fmt.Sprintf("jsonnetpkg-%s-%s", strings.Replace(name, "/", "-", -1), strings.Replace(version, "/", "-", -1)))) // using 16 bytes should be a good middle ground between length and collision resistance tmpDir, err := ioutil.TempDir(filepath.Join(dir, ".tmp"), hex.EncodeToString(pkgh[:16])) if err != nil {