Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kool start error message improv + verbose output improvement #483

Merged
merged 3 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions commands/start.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package commands

import (
"fmt"
"kool-dev/kool/core/builder"
"kool-dev/kool/core/environment"
"kool-dev/kool/core/network"
"kool-dev/kool/services/checker"
"kool-dev/kool/services/updater"
"strings"

"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -107,6 +109,9 @@ func (s *KoolStart) Execute(args []string) (err error) {
}

if err = s.checkDependencies(); err != nil {
if strings.HasPrefix(err.Error(), "no configuration file provided: not found") {
err = fmt.Errorf("could not find docker-compose.yml - check your current working directory.\n\n[err: %v]", err)
}
return
}

Expand Down
8 changes: 4 additions & 4 deletions core/shell/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ func (s *DefaultShell) Exec(command builder.Command, extraArgs ...string) (outSt
}

if verbose {
fmt.Fprintf(s.ErrStream(), "$ (exec) %s %v\n",
fmt.Fprintf(s.ErrStream(), "$ (exec) %s %s\n",
exe,
args,
strings.Join(args, " "),
)
}

Expand Down Expand Up @@ -174,11 +174,11 @@ func (s *DefaultShell) Interactive(originalCmd builder.Command, extraArgs ...str

if verbose {
checker := NewTerminalChecker()
fmt.Fprintf(s.ErrStream(), "$ (TTY in: %v out: %v) %s %v\n",
fmt.Fprintf(s.ErrStream(), "$ (TTY in: %v out: %v) %s %s\n",
checker.IsTerminal(cmdptr.in),
checker.IsTerminal(cmdptr.out),
cmdptr.Command.Cmd(),
cmdptr.Command.Args(),
strings.Join(cmdptr.Command.Args(), " "),
)
}

Expand Down
Loading