summaryrefslogtreecommitdiff
path: root/monoton.go
diff options
context:
space:
mode:
Diffstat (limited to 'monoton.go')
-rw-r--r--monoton.go5
1 files 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)
}