Skip to content

Commit

Permalink
Fix pipelines sync-status command flags handling (#2095)
Browse files Browse the repository at this point in the history
  • Loading branch information
sverdlov93 authored Jul 30, 2023
1 parent d8ebef4 commit 0c944d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion pipelines/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func createPipelinesDetailsByFlags(c *cli.Context) (*coreConfig.ServerDetails, e
if err != nil {
return nil, err
}
if plDetails.DistributionUrl == "" {
if plDetails.PipelinesUrl == "" {
return nil, fmt.Errorf("the --pipelines-url option is mandatory")
}
return plDetails, nil
Expand Down Expand Up @@ -138,7 +138,13 @@ func syncPipelineResources(c *cli.Context) error {
// getSyncPipelineResourcesStatus fetch sync status for a given repository path and branch name
func getSyncPipelineResourcesStatus(c *cli.Context) error {
branch := c.String("branch")
if branch == "" {
return cliutils.PrintHelpAndReturnError("The --branch option is mandatory.", c)
}
repository := c.String("repository")
if repository == "" {
return cliutils.PrintHelpAndReturnError("The --repository option is mandatory.", c)
}
clientlog.Info("Fetching pipeline sync status on repository:", repository, "branch:", branch)

// Fetch service details for authentication
Expand Down
4 changes: 2 additions & 2 deletions utils/cliutils/commandsflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,7 @@ var flagsMap = map[string]cli.Flag{
},
branch: cli.StringFlag{
Name: branch,
Usage: "[Optional] Branch name to filter.` `",
Usage: "[Mandatory] Branch name to filter.` `",
},
pipelineName: cli.StringFlag{
Name: pipelineName,
Expand All @@ -1554,7 +1554,7 @@ var flagsMap = map[string]cli.Flag{
},
repository: cli.StringFlag{
Name: repository,
Usage: "[Optional] Repository name to filter resource.` `",
Usage: "[Mandatory] Repository name to filter resource.` `",
},
singleBranch: cli.BoolFlag{
Name: singleBranch,
Expand Down

0 comments on commit 0c944d8

Please sign in to comment.