From fa9dd55107dd08830b2dc5e4cf52674ff19981cf Mon Sep 17 00:00:00 2001 From: Horus3 Date: Fri, 27 Feb 2015 19:40:20 +0100 Subject: Looks for the cmd additionally in $PATH now. --- monoton.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/monoton.go b/monoton.go index b19e23f..f52c797 100644 --- a/monoton.go +++ b/monoton.go @@ -23,8 +23,9 @@ func main() { cmd = fmt.Sprintf("%s", *cmd_f) vars = fmt.Sprintf("%s", *vars_f) - if _, err := os.Stat(cmd); os.IsNotExist(err) { - fmt.Println(err) + cmd, err := exec.LookPath(cmd) + if err != nil { + log.Printf("Executable (%s) neither found in PATH variable nor in working directory.\n", *cmd_f) os.Exit(1) } -- cgit v1.2.3