Skip to content

Commit

Permalink
Merge pull request #793 from garden-io/fix-crash-when-docker-not-in-path
Browse files Browse the repository at this point in the history
fix: crash when deploy and docker not installed
  • Loading branch information
eysi09 authored May 30, 2019
2 parents 6dcd5b4 + 540edb0 commit b84505d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions garden-service/src/util/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ export function spawn(cmd: string, args: string[], opts: SpawnOpts = {}) {
}, timeout * 1000)
}

proc.on("error", (err) => {
let msg = `An error occurred while trying to run '${cmd}'.`
if ((<any>err).code === "ENOENT") {
msg = `${msg} Please make sure '${cmd}' is installed and in the $PATH.`
}
_reject(new RuntimeError(msg, { cmd, args, opts, result, err }))
})

proc.on("close", (code) => {
_timeout && clearTimeout(_timeout)
result.code = code
Expand Down

0 comments on commit b84505d

Please sign in to comment.