From 05c472afd0bfc421151839494c9ffa95c352dc78 Mon Sep 17 00:00:00 2001 From: Connor Hindley Date: Thu, 5 Sep 2024 15:45:13 -0500 Subject: [PATCH] fix: Add scope a second time to getdeploypath Fixes https://github.com/jfrog/jfrog-cli/issues/2280 --- build/utils/npm.go | 2 +- build/utils/npm_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/utils/npm.go b/build/utils/npm.go index d697c4e3..289ecadb 100644 --- a/build/utils/npm.go +++ b/build/utils/npm.go @@ -514,7 +514,7 @@ func (pi *PackageInfo) GetDeployPath() string { if pi.Scope == "" { return fmt.Sprintf("%s/-/%s", pi.Name, fileName) } - return fmt.Sprintf("%s/%s/-/%s", pi.Scope, pi.Name, fileName) + return fmt.Sprintf("%s/%s/-/%s/%s", pi.Scope, pi.Name, pi.Scope, fileName) } func (pi *PackageInfo) FullName() string { diff --git a/build/utils/npm_test.go b/build/utils/npm_test.go index 7ef9ad67..8fc958ec 100644 --- a/build/utils/npm_test.go +++ b/build/utils/npm_test.go @@ -99,7 +99,7 @@ func TestGetDeployPath(t *testing.T) { pi *PackageInfo }{ {`build-info-go-tests/-/build-info-go-tests-1.0.0.tgz`, &PackageInfo{Name: "build-info-go-tests", Version: "1.0.0", Scope: ""}}, - {`@jfrog/build-info-go-tests/-/build-info-go-tests-1.0.0.tgz`, &PackageInfo{Name: "build-info-go-tests", Version: "1.0.0", Scope: "@jfrog"}}, + {`@jfrog/build-info-go-tests/-/@jfrog/build-info-go-tests-1.0.0.tgz`, &PackageInfo{Name: "build-info-go-tests", Version: "1.0.0", Scope: "@jfrog"}}, } for _, test := range testcases { t.Run(test.expectedPath, func(t *testing.T) {