{"action":"created","issue":{"url":"https://api.github.com/repos/robbiehanson/XcodeColors/issues/40","labels_url":"https://api.github.com/repos/robbiehanson/XcodeColors/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/robbiehanson/XcodeColors/issues/40/comments","events_url":"https://api.github.com/repos/robbiehanson/XcodeColors/issues/40/events","html_url":"https://github.com/robbiehanson/XcodeColors/issues/40","id":85888245,"number":40,"title":"Swift: Testing to see if XcodeColors is installed and enabled","user":{"login":"raphaklr","id":6332580,"avatar_url":"https://avatars.githubusercontent.com/u/6332580?v=3","gravatar_id":"","url":"https://api.github.com/users/raphaklr","html_url":"https://github.com/raphaklr","followers_url":"https://api.github.com/users/raphaklr/followers","following_url":"https://api.github.com/users/raphaklr/following{/other_user}","gists_url":"https://api.github.com/users/raphaklr/gists{/gist_id}","starred_url":"https://api.github.com/users/raphaklr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raphaklr/subscriptions","organizations_url":"https://api.github.com/users/raphaklr/orgs","repos_url":"https://api.github.com/users/raphaklr/repos","events_url":"https://api.github.com/users/raphaklr/events{/privacy}","received_events_url":"https://api.github.com/users/raphaklr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-07T10:36:11Z","updated_at":"2016-01-11T17:50:12Z","closed_at":null,"body":"In the README, you provided a code snippet in C for testing, if XcodeColors is installed and enabled. How would that code look like in Swift?"},"comment":{"url":"https://api.github.com/repos/robbiehanson/XcodeColors/issues/comments/170632488","html_url":"https://github.com/robbiehanson/XcodeColors/issues/40#issuecomment-170632488","issue_url":"https://api.github.com/repos/robbiehanson/XcodeColors/issues/40","id":170632488,"user":{"login":"jacobjohnston","id":1703107,"avatar_url":"https://avatars.githubusercontent.com/u/1703107?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobjohnston","html_url":"https://github.com/jacobjohnston","followers_url":"https://api.github.com/users/jacobjohnston/followers","following_url":"https://api.github.com/users/jacobjohnston/following{/other_user}","gists_url":"https://api.github.com/users/jacobjohnston/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobjohnston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobjohnston/subscriptions","organizations_url":"https://api.github.com/users/jacobjohnston/orgs","repos_url":"https://api.github.com/users/jacobjohnston/repos","events_url":"https://api.github.com/users/jacobjohnston/events{/privacy}","received_events_url":"https://api.github.com/users/jacobjohnston/received_events","type":"User","site_admin":false},"created_at":"2016-01-11T17:50:11Z","updated_at":"2016-01-11T17:50:11Z","body":"I'm not getting clear behavior on this either. In Swift, I would expect the code to check whether XcodeColors was installed to be something like this:\r\n\r\n```Swift\r\nlet canColor = NSProcessInfo().environment[\"XcodeColors\"] == \"YES\"\r\n````\r\n\r\nBut, that environment variable is always nil. However, if I go set it manually, it can read it fine.\r\n\r\n```Swift\r\nsetenv(\"XcodeColors\", \"YES\", 0)\r\nlet canColor = NSProcessInfo().environment[\"XcodeColors\"] == \"YES\"\r\n````\r\n\r\nThe colors DO work, I'm just not able to see if the plugin is installed. Any tips?"}}