Skip to content

Commit

Permalink
Improve repositores code
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Sverdlov <[email protected]>
  • Loading branch information
sverdlov93 committed Oct 30, 2024
1 parent 8e5269b commit 7423eb3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 8 additions & 0 deletions artifactory/commands/golang/go.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,3 +413,11 @@ func getArtifactoryApiUrl(repoName string, details auth.ServiceDetails, goProxyP

return goProxyParams.BuildUrl(rtUrl, repoName), nil
}

func GetModuleName(projectDir string) (string, error) {
path, err := biutils.GetModuleNameByDir(projectDir, log.Logger)
if err != nil {
return "", errorutils.CheckError(err)
}
return path, nil
}
10 changes: 1 addition & 9 deletions artifactory/commands/golang/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func publishPackage(packageVersion, targetRepo, buildName, buildNumber, projectK
}

// Read module name
moduleName, err := getModuleName(projectPath)
moduleName, err := GetModuleName(projectPath)
if err != nil {
return nil, nil, err
}
Expand Down Expand Up @@ -246,11 +246,3 @@ func getProjectRoot() (string, error) {
}
return path, nil
}

func getModuleName(projectDir string) (string, error) {
path, err := utils.GetModuleNameByDir(projectDir, log.Logger)
if err != nil {
return "", errorutils.CheckError(err)
}
return path, nil
}

0 comments on commit 7423eb3

Please sign in to comment.