Skip to content

Commit 29031ee

Browse files
authored
commands/operator-sdk: Add better error message when dep is not installed or not in path
Fix #163
1 parent 8cd582c commit 29031ee

File tree

1 file changed

+4
-0
lines changed
  • commands/operator-sdk/cmd

1 file changed

+4
-0
lines changed

commands/operator-sdk/cmd/new.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ func execCmd(stdout *os.File, cmd string, args ...string) {
161161
}
162162

163163
func pullDep() {
164+
_, err := exec.LookPath(dep)
165+
if err != nil {
166+
cmdError.ExitWithError(cmdError.ExitError, fmt.Errorf("Looking for dep in $PATH: %v", err))
167+
}
164168
fmt.Fprintln(os.Stdout, "Run dep ensure ...")
165169
execCmd(os.Stdout, dep, ensureCmd, "-v")
166170
fmt.Fprintln(os.Stdout, "Run dep ensure done")

0 commit comments

Comments
 (0)