diff options
| author | Horus3 | 2015-02-27 19:40:20 +0100 |
|---|---|---|
| committer | Horus3 | 2015-02-27 19:40:20 +0100 |
| commit | fa9dd55107dd08830b2dc5e4cf52674ff19981cf (patch) | |
| tree | 82d213113fc85c840ac996cccca617fb3243f90a | |
| parent | fe72ef7e03c0df883f8b120c77597f508509004a (diff) | |
| download | monotond-fa9dd55107dd08830b2dc5e4cf52674ff19981cf.tar.gz | |
Looks for the cmd additionally in $PATH now.
| -rw-r--r-- | monoton.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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) } |
