diff --git a/go.mod b/go.mod index 2309af00..df43d911 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.23.4 require ( github.com/Masterminds/semver v1.5.0 - github.com/jfrog/jfrog-cli-core/v2 v2.57.6 + github.com/jfrog/jfrog-cli-core/v2 v2.57.7 github.com/jfrog/jfrog-client-go v1.49.1 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index d87f24a2..519abd82 100644 --- a/go.sum +++ b/go.sum @@ -94,8 +94,8 @@ github.com/jfrog/build-info-go v1.10.8 h1:8D4wtvKzLS1hzfDWtfH4OliZLtLCgL62tXCnGW github.com/jfrog/build-info-go v1.10.8/go.mod h1:JcISnovFXKx3wWf3p1fcMmlPdt6adxScXvoJN4WXqIE= github.com/jfrog/gofrog v1.7.6 h1:QmfAiRzVyaI7JYGsB7cxfAJePAZTzFz0gRWZSE27c6s= github.com/jfrog/gofrog v1.7.6/go.mod h1:ntr1txqNOZtHplmaNd7rS4f8jpA5Apx8em70oYEe7+4= -github.com/jfrog/jfrog-cli-core/v2 v2.57.6 h1:kI5BqDW8Q4R5HkTUPSAObTqyIgQ9z7DqeFYGOEC1zPk= -github.com/jfrog/jfrog-cli-core/v2 v2.57.6/go.mod h1:h5pzOZUb5ChGcGrXCYr3nPyXcTZjeGW2Rm1Zceo8Afg= +github.com/jfrog/jfrog-cli-core/v2 v2.57.7 h1:2cZS9C5jBYpyCF4PoUzvGCnwFA7CsvG6jszCj1I3tsg= +github.com/jfrog/jfrog-cli-core/v2 v2.57.7/go.mod h1:ueB6LtU+gW7/hTyfKyka/BHi52oo5lEH46RodTly1PU= github.com/jfrog/jfrog-client-go v1.49.1 h1:AdJ+x+BSka3pCVDu6MCEvojwOmXvy1Q5S0dILvpfoDw= github.com/jfrog/jfrog-client-go v1.49.1/go.mod h1:ohIfKpMBCQsE9kunrKQ1wvoExpqsPLaluRFO186B5EM= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= @@ -195,8 +195,8 @@ github.com/terminalstatic/go-xsd-validate v0.1.6/go.mod h1:18lsvYFofBflqCrvo1ump github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc= github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/vbauerster/mpb/v8 v8.8.3 h1:dTOByGoqwaTJYPubhVz3lO5O6MK553XVgUo33LdnNsQ= -github.com/vbauerster/mpb/v8 v8.8.3/go.mod h1:JfCCrtcMsJwP6ZwMn9e5LMnNyp3TVNpUWWkN+nd4EWk= +github.com/vbauerster/mpb/v8 v8.9.1 h1:LH5R3lXPfE2e3lIGxN7WNWv3Hl5nWO6LRi2B0L0ERHw= +github.com/vbauerster/mpb/v8 v8.9.1/go.mod h1:4XMvznPh8nfe2NpnDo1QTPvW9MVkUhbG90mPWvmOzcQ= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= diff --git a/vendor/github.com/jfrog/jfrog-cli-core/v2/artifactory/utils/repositoryutils.go b/vendor/github.com/jfrog/jfrog-cli-core/v2/artifactory/utils/repositoryutils.go index 1e3aa39a..a11b91c6 100644 --- a/vendor/github.com/jfrog/jfrog-cli-core/v2/artifactory/utils/repositoryutils.go +++ b/vendor/github.com/jfrog/jfrog-cli-core/v2/artifactory/utils/repositoryutils.go @@ -1,7 +1,6 @@ package utils import ( - "fmt" "github.com/jfrog/gofrog/datastructures" "github.com/jfrog/jfrog-cli-core/v2/utils/config" "github.com/jfrog/jfrog-cli-core/v2/utils/ioutils" @@ -81,7 +80,7 @@ func IsRemoteRepo(repoName string, serviceManager artifactory.ArtifactoryService } // SelectRepositoryInteractively prompts the user to select a repository from a list of repositories that match the given filter parameters. -func SelectRepositoryInteractively(serverDetails *config.ServerDetails, repoFilterParams services.RepositoriesFilterParams) (string, error) { +func SelectRepositoryInteractively(serverDetails *config.ServerDetails, repoFilterParams services.RepositoriesFilterParams, promptMessage string) (string, error) { sm, err := CreateServiceManager(serverDetails, 3, 0, false) if err != nil { return "", err @@ -102,7 +101,7 @@ func SelectRepositoryInteractively(serverDetails *config.ServerDetails, repoFilt return filteredRepos[0], nil } // Prompt the user to select a repository. - return ioutils.AskFromListWithMismatchConfirmation(fmt.Sprintf("Please select a %s %s repository to configure:", repoFilterParams.RepoType, repoFilterParams.PackageType), "Repository not found.", ioutils.ConvertToSuggests(filteredRepos)), nil + return ioutils.AskFromListWithMismatchConfirmation(promptMessage, "Repository not found.", ioutils.ConvertToSuggests(filteredRepos)), nil } // GetFilteredRepositoriesWithFilterParams returns the names of local, remote, virtual, and federated repositories filtered by their names and type. diff --git a/vendor/github.com/jfrog/jfrog-cli-core/v2/artifactory/utils/utils.go b/vendor/github.com/jfrog/jfrog-cli-core/v2/artifactory/utils/utils.go index 0ebe4226..8cef7b4f 100644 --- a/vendor/github.com/jfrog/jfrog-cli-core/v2/artifactory/utils/utils.go +++ b/vendor/github.com/jfrog/jfrog-cli-core/v2/artifactory/utils/utils.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "errors" + "fmt" "io" "net/http" "net/url" @@ -314,7 +315,7 @@ func ValidateRepoExists(repoKey string, serviceDetails auth.ServiceDetails) erro } exists, err := servicesManager.IsRepoExists(repoKey) if err != nil { - return err + return fmt.Errorf("failed while attempting to check if repository %q exists in Artifactory: %w", repoKey, err) } if !exists { diff --git a/vendor/github.com/jfrog/jfrog-cli-core/v2/utils/coreutils/cmdutils.go b/vendor/github.com/jfrog/jfrog-cli-core/v2/utils/coreutils/cmdutils.go index d57783c7..791cce9e 100644 --- a/vendor/github.com/jfrog/jfrog-cli-core/v2/utils/coreutils/cmdutils.go +++ b/vendor/github.com/jfrog/jfrog-cli-core/v2/utils/coreutils/cmdutils.go @@ -230,7 +230,7 @@ func extractBoolOptionFromArgs(args []string, optionName string) (cleanArgs []st // Add green color style to the string if possible. func PrintTitle(str string) string { - return colorStr(str, color.Green) + return PrintGreen(str) } // Add cyan color style to the string if possible. @@ -253,11 +253,21 @@ func PrintComment(str string) string { return colorStr(str, color.Gray) } +// Add red color style to the string if possible. +func PrintRed(str string) string { + return colorStr(str, color.Red) +} + // Add yellow color style to the string if possible. func PrintYellow(str string) string { return colorStr(str, color.Yellow) } +// Add green color style to the string if possible. +func PrintGreen(str string) string { + return colorStr(str, color.Green) +} + // Add the requested style to the string if possible. func colorStr(str string, c color.Color) string { // Add styles only on supported terminals diff --git a/vendor/github.com/jfrog/jfrog-cli-core/v2/utils/coreutils/utils.go b/vendor/github.com/jfrog/jfrog-cli-core/v2/utils/coreutils/utils.go index b0338d80..434df850 100644 --- a/vendor/github.com/jfrog/jfrog-cli-core/v2/utils/coreutils/utils.go +++ b/vendor/github.com/jfrog/jfrog-cli-core/v2/utils/coreutils/utils.go @@ -64,6 +64,9 @@ func init() { if cliTempDir == "" { cliTempDir = os.TempDir() } + if err := fileutils.CreateDirIfNotExist(cliTempDir); err != nil { + log.Error("failed to create temp dir at:", cliTempDir) + } fileutils.SetTempDirBase(cliTempDir) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 8eddeb4a..15ba1450 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -225,8 +225,8 @@ github.com/jfrog/gofrog/safeconvert github.com/jfrog/gofrog/stringutils github.com/jfrog/gofrog/unarchive github.com/jfrog/gofrog/version -# github.com/jfrog/jfrog-cli-core/v2 v2.57.6 -## explicit; go 1.23.3 +# github.com/jfrog/jfrog-cli-core/v2 v2.57.7 +## explicit; go 1.23.4 github.com/jfrog/jfrog-cli-core/v2/artifactory/commands/generic github.com/jfrog/jfrog-cli-core/v2/artifactory/commands/utils github.com/jfrog/jfrog-cli-core/v2/artifactory/utils