summaryrefslogtreecommitdiff
path: root/monoton.go
diff options
context:
space:
mode:
authorHorus32015-02-27 19:40:20 +0100
committerHorus32015-02-27 19:40:20 +0100
commitfa9dd55107dd08830b2dc5e4cf52674ff19981cf (patch)
tree82d213113fc85c840ac996cccca617fb3243f90a /monoton.go
parentfe72ef7e03c0df883f8b120c77597f508509004a (diff)
downloadmonotond-fa9dd55107dd08830b2dc5e4cf52674ff19981cf.tar.gz
Looks for the cmd additionally in $PATH now.
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)
}