Skip to content

Commit

Permalink
Improve upload archive progress bar
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Sverdlov <michaelsv@jfrog.com>
  • Loading branch information
sverdlov93 committed Jan 6, 2025
1 parent fd928f7 commit 97c4fe2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ func (pmlc *PackageManagerLoginCommand) promptUserToSelectRepository() (err erro
}

// Prompt for repository selection based on filter parameters.
pmlc.repoName, err = utils.SelectRepositoryInteractively(pmlc.serverDetails, repoFilterParams)
pmlc.repoName, err = utils.SelectRepositoryInteractively(
pmlc.serverDetails,
repoFilterParams,
fmt.Sprintf("To configure %s, we need you to select a %s repository in Artifactory", repoFilterParams.PackageType, repoFilterParams.RepoType))

return err
}

Expand Down
5 changes: 2 additions & 3 deletions artifactory/utils/repositoryutils.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 97c4fe2

Please sign in to comment.