Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

Commit

Permalink
update external command error message
Browse files Browse the repository at this point in the history
  • Loading branch information
martinnirtl committed Feb 25, 2020
1 parent 51a3196 commit 11920b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions internal/commands/envcmd/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func runPullCommand(cmd *cobra.Command, args []string) {

// FIXME duplicated code > see env init cmd
if _, err := os.Stat(".git"); !os.IsNotExist(err) {
pull := survey.Select(fmt.Sprintf("Run %s before %s", chalk.Cyan.Color("git pull"), chalk.Cyan.Color("dockma up")), []string{"auto", "optional", "manual", "off"})
pull := survey.Select(fmt.Sprintf("Environment is now git-based. Run %s before %s", chalk.Cyan.Color("git pull"), chalk.Cyan.Color("dockma up")), []string{"auto", "optional", "manual", "off"})

viper.Set(fmt.Sprintf("envs.%s.pull", envName), pull)

Expand Down Expand Up @@ -106,11 +106,7 @@ func Pull(path string, hideCmdOutput bool, writeToDockmaLog bool) (output []byte
logfile = config.GetSubcommandLogfile()
}

output, cmdErr := externalcommand.Execute("git pull", timebridger, logfile)

if cmdErr != nil {
err = errors.New("Could not execute 'git pull'")
}
output, err = externalcommand.Execute("git pull", timebridger, logfile)

// activeEnv.SetUpdated() // TODO make config to object

Expand Down
2 changes: 1 addition & 1 deletion pkg/externalcommand/externalcommand.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func Execute(command string, timebridger Timebridger, logfile string) ([]byte, e
}

if commandError != nil {
return output, fmt.Errorf("Could not run command %s", chalk.Underline.TextStyle(command))
return output, fmt.Errorf("Could not execute command %s", chalk.Underline.TextStyle(command))
}

return output, nil
Expand Down

0 comments on commit 11920b5

Please sign in to comment.