{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/nomad/issues/163","labels_url":"https://api.github.com/repos/hashicorp/nomad/issues/163/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/nomad/issues/163/comments","events_url":"https://api.github.com/repos/hashicorp/nomad/issues/163/events","html_url":"https://github.com/hashicorp/nomad/issues/163","id":108960195,"number":163,"title":"looking for nomad executable is checking gopath twice","user":{"login":"mgenov","id":209223,"avatar_url":"https://avatars.githubusercontent.com/u/209223?v=3","gravatar_id":"","url":"https://api.github.com/users/mgenov","html_url":"https://github.com/mgenov","followers_url":"https://api.github.com/users/mgenov/followers","following_url":"https://api.github.com/users/mgenov/following{/other_user}","gists_url":"https://api.github.com/users/mgenov/gists{/gist_id}","starred_url":"https://api.github.com/users/mgenov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgenov/subscriptions","organizations_url":"https://api.github.com/users/mgenov/orgs","repos_url":"https://api.github.com/users/mgenov/repos","events_url":"https://api.github.com/users/mgenov/events{/privacy}","received_events_url":"https://api.github.com/users/mgenov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-29T21:08:27Z","updated_at":"2015-09-29T22:14:32Z","closed_at":null,"body":"The NomadExecutable function is checking twice where executable is in GOPATH instead of checking and the current working directory as comment says. \r\n\r\n```go\r\n      // Check the $GOPATH.\r\n       bin = filepath.Join(os.Getenv(\"GOPATH\"), \"bin\", nomadExe)\r\n       if _, err := os.Stat(bin); err == nil {\r\n                return bin, nil\r\n       }\r\n\r\n      // Check the CWD.\r\n      bin = filepath.Join(os.Getenv(\"GOPATH\"), \"bin\", nomadExe)\r\n      if _, err := os.Stat(bin); err == nil {\r\n                return bin, nil\r\n      }\r\n```\r\n\r\nCould be changed to: \r\n```go\r\n      // Check the $GOPATH.\r\n       bin = filepath.Join(os.Getenv(\"GOPATH\"), \"bin\", nomadExe)\r\n       if _, err := os.Stat(bin); err == nil {\r\n                return bin, nil\r\n       }\r\n\r\n      // Check the CWD.\r\n      bin = filepath.Join(os.Getenv(\"PWD\"), \"bin\", nomadExe)\r\n      if _, err := os.Stat(bin); err == nil {\r\n                return bin, nil\r\n      }\r\n```"},"comment":{"url":"https://api.github.com/repos/hashicorp/nomad/issues/comments/144206445","html_url":"https://github.com/hashicorp/nomad/issues/163#issuecomment-144206445","issue_url":"https://api.github.com/repos/hashicorp/nomad/issues/163","id":144206445,"user":{"login":"ryanuber","id":1642288,"avatar_url":"https://avatars.githubusercontent.com/u/1642288?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanuber","html_url":"https://github.com/ryanuber","followers_url":"https://api.github.com/users/ryanuber/followers","following_url":"https://api.github.com/users/ryanuber/following{/other_user}","gists_url":"https://api.github.com/users/ryanuber/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanuber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanuber/subscriptions","organizations_url":"https://api.github.com/users/ryanuber/orgs","repos_url":"https://api.github.com/users/ryanuber/repos","events_url":"https://api.github.com/users/ryanuber/events{/privacy}","received_events_url":"https://api.github.com/users/ryanuber/received_events","type":"User","site_admin":false},"created_at":"2015-09-29T22:14:32Z","updated_at":"2015-09-29T22:14:32Z","body":"Hmm, looks like something that could maybe just be solved by scanning `$PATH` plus the local directory for the nomadExe though I'm not sure about cross-platform in that case. Marking as an enhancement, thanks! /cc @dadgar"}}