Skip to content

Commit

Permalink
fix: crash when deploy and docker not installed
Browse files Browse the repository at this point in the history
Fixes #768
  • Loading branch information
10ko authored and edvald committed May 29, 2019
1 parent 6dcd5b4 commit 540edb0
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 540edb0

Please sign in to comment.