Skip to content

Commit

Permalink
Merge 3534e22 into 53a7c3c
Browse files Browse the repository at this point in the history
  • Loading branch information
dharmit authored Aug 11, 2022
2 parents 53a7c3c + 3534e22 commit 29be44a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (a *adapterHandler) Execute(devfileCmd devfilev1.Command) error {
// Creating with no spin because the command could be long-running, and we cannot determine when it will end.
s.Start(fmt.Sprintf("Executing the application (command: %s)", devfileCmd.Id), true)
case remotecmd.Stopped, remotecmd.Errored:
s.End(status == remotecmd.Stopped)
s.EndWithStatus(fmt.Sprintf("Finished executing the application (command: %s)", devfileCmd.Id), status == remotecmd.Stopped)
if err != nil {
klog.V(2).Infof("error while running background command: %v", err)
}
Expand Down
9 changes: 9 additions & 0 deletions pkg/log/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,15 @@ func (s *Status) End(success bool) {
s.status = ""
}

// EndWithStatus is similar to End, but lets the user specify a custom message/status while ending
func (s *Status) EndWithStatus(status string, success bool) {
if status == "" {
return
}
s.status = status
s.End(success)
}

// Printf will output in an appropriate "information" manner; for e.g.
// • <message>
func Printf(format string, a ...interface{}) {
Expand Down

0 comments on commit 29be44a

Please sign in to comment.