Skip to content

Commit

Permalink
naming
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinAbro321 committed Apr 18, 2024
1 parent fbdfeac commit 5e14aed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/pkg/packager/creator/normal.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type PackageCreator struct {
cfg *types.PackagerConfig
}

func localizeDifferentialPackagePath(path string, cwd string) string {
func updateRelativeDifferentialPackagePath(path string, cwd string) string {
if path != "" && !filepath.IsAbs(path) && !helpers.IsURL(path) {
return filepath.Join(cwd, path)
}
Expand All @@ -57,7 +57,7 @@ func localizeDifferentialPackagePath(path string, cwd string) string {

// NewPackageCreator returns a new PackageCreator.
func NewPackageCreator(createOpts types.ZarfCreateOptions, cfg *types.PackagerConfig, cwd string) *PackageCreator {
createOpts.DifferentialPackagePath = localizeDifferentialPackagePath(createOpts.DifferentialPackagePath, cwd)
createOpts.DifferentialPackagePath = updateRelativeDifferentialPackagePath(createOpts.DifferentialPackagePath, cwd)
return &PackageCreator{createOpts, cfg}
}

Expand Down
4 changes: 2 additions & 2 deletions src/pkg/packager/creator/normal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestNewImportChain(t *testing.T) {
func TestDifferentialPackagePathSetCorrectly(t *testing.T) {
type testCase struct {
name string
path string
Expand Down Expand Up @@ -49,7 +49,7 @@ func TestNewImportChain(t *testing.T) {

t.Run(tc.name, func(t *testing.T) {
t.Parallel()
require.Equal(t, tc.expected, localizeDifferentialPackagePath(tc.path, tc.cwd))
require.Equal(t, tc.expected, updateRelativeDifferentialPackagePath(tc.path, tc.cwd))
})
}
}

0 comments on commit 5e14aed

Please sign in to comment.