Skip to content

Commit

Permalink
Do not display message when using no-watch flag (#6116)
Browse files Browse the repository at this point in the history
  • Loading branch information
feloy authored Sep 13, 2022
1 parent 59f4f83 commit 8b5986f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
19 changes: 16 additions & 3 deletions pkg/watch/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ func processEvents(
if oldStatus.State != StateReady && componentStatus.State == StateReady ||
!reflect.DeepEqual(oldStatus.EndpointsForwarded, componentStatus.EndpointsForwarded) {

printInfoMessage(out, parameters.Path)
printInfoMessage(out, parameters.Path, parameters.WatchFiles)
}
return nil, nil
}
Expand Down Expand Up @@ -544,9 +544,22 @@ func removeDuplicates(input []string) []string {
return result
}

func printInfoMessage(out io.Writer, path string) {
func printInfoMessage(out io.Writer, path string, watchFiles bool) {
log.Sectionf("Dev mode")
fmt.Fprintf(out, " %s\n Watching for changes in the current directory %s\n\n %s%s", log.Sbold("Status:"), path, log.Sbold("Keyboard Commands:"), PromptMessage)
if watchFiles {
fmt.Fprintf(
out,
" %s\n Watching for changes in the current directory %s\n\n",
log.Sbold("Status:"),
path,
)
}
fmt.Fprintf(
out,
" %s%s",
log.Sbold("Keyboard Commands:"),
PromptMessage,
)
}

func isFatal(err error) bool {
Expand Down
2 changes: 1 addition & 1 deletion tests/helper/helper_dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (o DevSession) WaitEnd() {
// since the end of the dev mode or the last time WaitSync/GetInfo has been called
func (o DevSession) WaitSync() ([]byte, []byte, map[string]string, error) {
WaitForOutputToContainOne([]string{"Pushing files...", "Updating Component..."}, 180, 10, o.session)
WaitForOutputToContain("Watching for changes in the current directory", 240, 10, o.session)
WaitForOutputToContain("Dev mode", 240, 10, o.session)
return o.GetInfo()
}

Expand Down

0 comments on commit 8b5986f

Please sign in to comment.