From 82c02e1b36570aa8ad354eb2f307866728897828 Mon Sep 17 00:00:00 2001 From: Pierre Mavro Date: Sat, 8 Sep 2018 00:27:58 +0200 Subject: [PATCH] fix: error when deploying all apps for 1 client --- cmd/deploy.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/deploy.go b/cmd/deploy.go index d8c89d8..32ee509 100644 --- a/cmd/deploy.go +++ b/cmd/deploy.go @@ -20,7 +20,7 @@ type Pipelines struct { // deployCmd represents the deploy command var deployCmd = &cobra.Command{ - Use: "deploy [app name]", + Use: "deploy [app name]", Short: "Deploy client ID applications and application (optional)", Args: cobra.RangeArgs(1, 2), Run: func(cmd *cobra.Command, args []string) { @@ -158,6 +158,10 @@ func gitlabRunJob(git *gitlab.Client, pipelineId int, jobs []*gitlab.Job, jobNam if err != nil { log.Fatalf("Wasn't able to play job %s id %s on pipeline %s: %s", jobName, strconv.Itoa(jobId), strconv.Itoa(pipelineId), err) } - log.Infof("Job successfully been launched (%s/%s)", args[0], args[1]) + if len(args) == 2 { + log.Infof("Job successfully been launched (%s/%s)", args[0], args[1]) + } else { + log.Infof("Job successfully been launched (%s)", args[0]) + } log.Infof("Job progression: https://gitlab.com/%s/-/jobs/%s", viper.GetString("gitlab_project_name"), strconv.Itoa(jobId)) } \ No newline at end of file