{"action":"closed","issue":{"url":"https://api.github.com/repos/JamesMGreene/chef-gocd-agent/issues/1","labels_url":"https://api.github.com/repos/JamesMGreene/chef-gocd-agent/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/JamesMGreene/chef-gocd-agent/issues/1/comments","events_url":"https://api.github.com/repos/JamesMGreene/chef-gocd-agent/issues/1/events","html_url":"https://github.com/JamesMGreene/chef-gocd-agent/issues/1","id":100898334,"number":1,"title":"Windows supported mixlib shellout invocation","user":{"login":"webframp","id":774378,"avatar_url":"https://avatars.githubusercontent.com/u/774378?v=3","gravatar_id":"","url":"https://api.github.com/users/webframp","html_url":"https://github.com/webframp","followers_url":"https://api.github.com/users/webframp/followers","following_url":"https://api.github.com/users/webframp/following{/other_user}","gists_url":"https://api.github.com/users/webframp/gists{/gist_id}","starred_url":"https://api.github.com/users/webframp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webframp/subscriptions","organizations_url":"https://api.github.com/users/webframp/orgs","repos_url":"https://api.github.com/users/webframp/repos","events_url":"https://api.github.com/users/webframp/events{/privacy}","received_events_url":"https://api.github.com/users/webframp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JamesMGreene/chef-gocd-agent/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"JamesMGreene","id":417751,"avatar_url":"https://avatars.githubusercontent.com/u/417751?v=3","gravatar_id":"","url":"https://api.github.com/users/JamesMGreene","html_url":"https://github.com/JamesMGreene","followers_url":"https://api.github.com/users/JamesMGreene/followers","following_url":"https://api.github.com/users/JamesMGreene/following{/other_user}","gists_url":"https://api.github.com/users/JamesMGreene/gists{/gist_id}","starred_url":"https://api.github.com/users/JamesMGreene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JamesMGreene/subscriptions","organizations_url":"https://api.github.com/users/JamesMGreene/orgs","repos_url":"https://api.github.com/users/JamesMGreene/repos","events_url":"https://api.github.com/users/JamesMGreene/events{/privacy}","received_events_url":"https://api.github.com/users/JamesMGreene/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-08-14T00:10:58Z","updated_at":"2015-08-25T20:42:36Z","closed_at":"2015-08-25T20:42:36Z","body":"For https://github.com/JamesMGreene/chef-gocd-agent/blob/master/attributes/default.rb#L31\r\n\r\nseems to result in:\r\n```\r\n       Mixlib::ShellOut::InvalidCommandOption\r\n       --------------------------------------\r\n       You must supply both a username and password when supplying a user in windows\r\n```\r\n\r\nperhaps that could be adjusted. This is pretty ugly, but maybe it would be enough?\r\n\r\n```ruby\r\nif !(ENV['JAVA_HOME'].nil? || ENV['JAVA_HOME'].empty?)\r\n  default['gocd_agent']['java_home'] = ENV['JAVA_HOME']\r\nelse\r\n  case node['platform_family']\r\n  when 'windows'\r\n    cmd = Mixlib::ShellOut.new('echo \"${JAVA_HOME}\"')\r\n  else\r\n    cmd = Mixlib::ShellOut.new('echo \"${JAVA_HOME}\"', :user => 'root')\r\n  end\r\n```\r\n\r\ncurious why the shellout was needed for echo instead of accessing the env var directly via `ENV['JAVA_HOME']`"}}