From 16b77ec5087611766969613f1adf63518fe5eaab Mon Sep 17 00:00:00 2001 From: Lyon Hill Date: Tue, 14 Feb 2017 09:27:22 -0700 Subject: [PATCH] allow custom components to run without nanobox's hooks --- util/hookit/hookit.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/hookit/hookit.go b/util/hookit/hookit.go index 9679489d..17b543e6 100644 --- a/util/hookit/hookit.go +++ b/util/hookit/hookit.go @@ -13,10 +13,11 @@ import ( // Exec executes a hook inside of a container func Exec(container, hook, payload, displayLevel string) (string, error) { out, err := util.DockerExec(container, "root", "/opt/nanobox/hooks/"+hook, []string{payload}, display.NewStreamer(displayLevel)) - if err != nil && (strings.Contains(string(out), "No such file or directory") && strings.Contains(err.Error(), "bad exit code(126)")) { + if err != nil && (strings.Contains(string(out), "such file or directory") && strings.Contains(err.Error(), "bad exit code(126)")) { // if its a 126 the hook didnt exist return "", nil } + if err != nil { return out, util.ErrorAppend(err, "failed to exe in container") }