{"action":"created","comment":{"url":"https://api.github.com/repos/vokal/XcodeAutoBasher/pulls/comments/34486781","id":34486781,"diff_hunk":"@@ -116,6 +116,52 @@ - (VOKDirectoryWatcher *)directoryWatcher\n     return _directoryWatcher;\n }\n \n+- (NSDictionary *)environmentVariables\n+{\n+    if ([NSThread isMainThread]) {\n+        NSLog(@\"VOKProjectContainer environmentVariables being retrieved on the main thread.\");\n+    }\n+    NSPipe *outputPipe = [NSPipe pipe];\n+    \n+    NSTask *buildSettingsTask = [[NSTask alloc] init];\n+    buildSettingsTask.launchPath = @\"/usr/bin/xcodebuild\";\n+    buildSettingsTask.currentDirectoryPath = self.containingPath;\n+    buildSettingsTask.arguments = @[ @\"-showBuildSettings\", ];\n+    buildSettingsTask.standardOutput = outputPipe;\n+    \n+    [buildSettingsTask launch];\n+    [buildSettingsTask waitUntilExit];\n+    \n+    NSData *outputData = [outputPipe.fileHandleForReading readDataToEndOfFile];\n+    NSString *outputString = [[NSString alloc] initWithData:outputData encoding:NSUTF8StringEncoding];\n+    \n+    NSError *error;\n+    NSRegularExpression *regex = [NSRegularExpression\n+                                  regularExpressionWithPattern:\n+                                  @\"^[[:space:]]*([^[:space:]]*)[[:space:]]*=[[:space:]]*(.*)$\"\n+                                  options:NSRegularExpressionAnchorsMatchLines\n+                                  error:&error];\n+    if (!regex) {\n+        NSLog(@\"VOKProjectContainer error making regex: %@\", error);\n+        return nil;\n+    }\n+    \n+    NSMutableDictionary *env = [NSMutableDictionary dictionary];\n+    [regex\n+     enumerateMatchesInString:outputString\n+     options:NSMatchingReportProgress\n+     range:NSMakeRange(0, outputString.length)\n+     usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) {\n+         if (result.numberOfRanges != 3) {","path":"XcodeAutoBasher/XcodeAutoBasher/Models/VOKProjectContainer.m","position":40,"original_position":40,"commit_id":"f9a17e27a77925ff96d85108330e2f4c6e776e74","original_commit_id":"f9a17e27a77925ff96d85108330e2f4c6e776e74","user":{"login":"vokal-isaac","id":7505072,"avatar_url":"https://avatars.githubusercontent.com/u/7505072?v=3","gravatar_id":"","url":"https://api.github.com/users/vokal-isaac","html_url":"https://github.com/vokal-isaac","followers_url":"https://api.github.com/users/vokal-isaac/followers","following_url":"https://api.github.com/users/vokal-isaac/following{/other_user}","gists_url":"https://api.github.com/users/vokal-isaac/gists{/gist_id}","starred_url":"https://api.github.com/users/vokal-isaac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vokal-isaac/subscriptions","organizations_url":"https://api.github.com/users/vokal-isaac/orgs","repos_url":"https://api.github.com/users/vokal-isaac/repos","events_url":"https://api.github.com/users/vokal-isaac/events{/privacy}","received_events_url":"https://api.github.com/users/vokal-isaac/received_events","type":"User","site_admin":false},"body":"Essentially, it's a guard against going out of bounds when requesting the ranges at indexes 1 and 2, immediately below—that's why I didn't document it, but I'll add the comment.","created_at":"2015-07-13T17:16:45Z","updated_at":"2015-07-13T17:16:45Z","html_url":"https://github.com/vokal/XcodeAutoBasher/pull/13#discussion_r34486781","pull_request_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/vokal/XcodeAutoBasher/pulls/comments/34486781"},"html":{"href":"https://github.com/vokal/XcodeAutoBasher/pull/13#discussion_r34486781"},"pull_request":{"href":"https://api.github.com/repos/vokal/XcodeAutoBasher/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/vokal/XcodeAutoBasher/pulls/13","id":39724560,"html_url":"https://github.com/vokal/XcodeAutoBasher/pull/13","diff_url":"https://github.com/vokal/XcodeAutoBasher/pull/13.diff","patch_url":"https://github.com/vokal/XcodeAutoBasher/pull/13.patch","issue_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/issues/13","number":13,"state":"open","locked":false,"title":"Environment Variables!","user":{"login":"vokal-isaac","id":7505072,"avatar_url":"https://avatars.githubusercontent.com/u/7505072?v=3","gravatar_id":"","url":"https://api.github.com/users/vokal-isaac","html_url":"https://github.com/vokal-isaac","followers_url":"https://api.github.com/users/vokal-isaac/followers","following_url":"https://api.github.com/users/vokal-isaac/following{/other_user}","gists_url":"https://api.github.com/users/vokal-isaac/gists{/gist_id}","starred_url":"https://api.github.com/users/vokal-isaac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vokal-isaac/subscriptions","organizations_url":"https://api.github.com/users/vokal-isaac/orgs","repos_url":"https://api.github.com/users/vokal-isaac/repos","events_url":"https://api.github.com/users/vokal-isaac/events{/privacy}","received_events_url":"https://api.github.com/users/vokal-isaac/received_events","type":"User","site_admin":false},"body":"Resolves #12.\r\n\r\nThis provides the running task with the environment variables as reported by `xcodebuild -showBuildVariables`.  Because that's run synchronously, the task-launching has been moved to a background thread.\r\n\r\nI wasn't sure how best to express this in the README, especially since using the environment variables will make the advice about testing the script in Terminal very hard to follow.\r\n\r\n@designatednerd Wanna review this or should I `@`-ping the whole team?","created_at":"2015-07-10T21:06:52Z","updated_at":"2015-07-13T17:16:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b2b501c9640be116b71392e09c9be50a4dd24843","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/pulls/13/commits","review_comments_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/pulls/13/comments","review_comment_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/issues/13/comments","statuses_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/statuses/f9a17e27a77925ff96d85108330e2f4c6e776e74","head":{"label":"vokal-isaac:feature/environmentVariables","ref":"feature/environmentVariables","sha":"f9a17e27a77925ff96d85108330e2f4c6e776e74","user":{"login":"vokal-isaac","id":7505072,"avatar_url":"https://avatars.githubusercontent.com/u/7505072?v=3","gravatar_id":"","url":"https://api.github.com/users/vokal-isaac","html_url":"https://github.com/vokal-isaac","followers_url":"https://api.github.com/users/vokal-isaac/followers","following_url":"https://api.github.com/users/vokal-isaac/following{/other_user}","gists_url":"https://api.github.com/users/vokal-isaac/gists{/gist_id}","starred_url":"https://api.github.com/users/vokal-isaac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vokal-isaac/subscriptions","organizations_url":"https://api.github.com/users/vokal-isaac/orgs","repos_url":"https://api.github.com/users/vokal-isaac/repos","events_url":"https://api.github.com/users/vokal-isaac/events{/privacy}","received_events_url":"https://api.github.com/users/vokal-isaac/received_events","type":"User","site_admin":false},"repo":{"id":24693158,"name":"XcodeScriptWriter","full_name":"vokal-isaac/XcodeScriptWriter","owner":{"login":"vokal-isaac","id":7505072,"avatar_url":"https://avatars.githubusercontent.com/u/7505072?v=3","gravatar_id":"","url":"https://api.github.com/users/vokal-isaac","html_url":"https://github.com/vokal-isaac","followers_url":"https://api.github.com/users/vokal-isaac/followers","following_url":"https://api.github.com/users/vokal-isaac/following{/other_user}","gists_url":"https://api.github.com/users/vokal-isaac/gists{/gist_id}","starred_url":"https://api.github.com/users/vokal-isaac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vokal-isaac/subscriptions","organizations_url":"https://api.github.com/users/vokal-isaac/orgs","repos_url":"https://api.github.com/users/vokal-isaac/repos","events_url":"https://api.github.com/users/vokal-isaac/events{/privacy}","received_events_url":"https://api.github.com/users/vokal-isaac/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vokal-isaac/XcodeScriptWriter","description":"An Xcode plugin to run a given script any time a given folder or its children have changes. ","fork":true,"url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter","forks_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/forks","keys_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/teams","hooks_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/hooks","issue_events_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/issues/events{/number}","events_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/events","assignees_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/assignees{/user}","branches_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/branches{/branch}","tags_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/tags","blobs_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/git/refs{/sha}","trees_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/statuses/{sha}","languages_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/languages","stargazers_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/stargazers","contributors_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/contributors","subscribers_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/subscribers","subscription_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/subscription","commits_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/commits{/sha}","git_commits_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/git/commits{/sha}","comments_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/comments{/number}","issue_comment_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/issues/comments{/number}","contents_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/contents/{+path}","compare_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/merges","archive_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/downloads","issues_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/issues{/number}","pulls_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/pulls{/number}","milestones_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/milestones{/number}","notifications_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/labels{/name}","releases_url":"https://api.github.com/repos/vokal-isaac/XcodeScriptWriter/releases{/id}","created_at":"2014-10-01T19:57:29Z","updated_at":"2014-10-24T17:19:53Z","pushed_at":"2015-07-10T21:18:25Z","git_url":"git://github.com/vokal-isaac/XcodeScriptWriter.git","ssh_url":"git@github.com:vokal-isaac/XcodeScriptWriter.git","clone_url":"https://github.com/vokal-isaac/XcodeScriptWriter.git","svn_url":"https://github.com/vokal-isaac/XcodeScriptWriter","homepage":null,"size":388,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"vokal:master","ref":"master","sha":"d3465ee73796e48c5f991051496b83fd7d79b95e","user":{"login":"vokal","id":375026,"avatar_url":"https://avatars.githubusercontent.com/u/375026?v=3","gravatar_id":"","url":"https://api.github.com/users/vokal","html_url":"https://github.com/vokal","followers_url":"https://api.github.com/users/vokal/followers","following_url":"https://api.github.com/users/vokal/following{/other_user}","gists_url":"https://api.github.com/users/vokal/gists{/gist_id}","starred_url":"https://api.github.com/users/vokal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vokal/subscriptions","organizations_url":"https://api.github.com/users/vokal/orgs","repos_url":"https://api.github.com/users/vokal/repos","events_url":"https://api.github.com/users/vokal/events{/privacy}","received_events_url":"https://api.github.com/users/vokal/received_events","type":"Organization","site_admin":false},"repo":{"id":24188742,"name":"XcodeAutoBasher","full_name":"vokal/XcodeAutoBasher","owner":{"login":"vokal","id":375026,"avatar_url":"https://avatars.githubusercontent.com/u/375026?v=3","gravatar_id":"","url":"https://api.github.com/users/vokal","html_url":"https://github.com/vokal","followers_url":"https://api.github.com/users/vokal/followers","following_url":"https://api.github.com/users/vokal/following{/other_user}","gists_url":"https://api.github.com/users/vokal/gists{/gist_id}","starred_url":"https://api.github.com/users/vokal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vokal/subscriptions","organizations_url":"https://api.github.com/users/vokal/orgs","repos_url":"https://api.github.com/users/vokal/repos","events_url":"https://api.github.com/users/vokal/events{/privacy}","received_events_url":"https://api.github.com/users/vokal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vokal/XcodeAutoBasher","description":"An Xcode plugin to run a given script any time a given folder or its children have changes. ","fork":false,"url":"https://api.github.com/repos/vokal/XcodeAutoBasher","forks_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/forks","keys_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/teams","hooks_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/hooks","issue_events_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/issues/events{/number}","events_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/events","assignees_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/assignees{/user}","branches_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/branches{/branch}","tags_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/tags","blobs_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/git/refs{/sha}","trees_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/statuses/{sha}","languages_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/languages","stargazers_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/stargazers","contributors_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/contributors","subscribers_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/subscribers","subscription_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/subscription","commits_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/commits{/sha}","git_commits_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/git/commits{/sha}","comments_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/comments{/number}","issue_comment_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/issues/comments{/number}","contents_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/contents/{+path}","compare_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/merges","archive_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/downloads","issues_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/issues{/number}","pulls_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/pulls{/number}","milestones_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/milestones{/number}","notifications_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/labels{/name}","releases_url":"https://api.github.com/repos/vokal/XcodeAutoBasher/releases{/id}","created_at":"2014-09-18T13:15:49Z","updated_at":"2015-04-13T18:38:27Z","pushed_at":"2015-07-10T21:06:52Z","git_url":"git://github.com/vokal/XcodeAutoBasher.git","ssh_url":"git@github.com:vokal/XcodeAutoBasher.git","clone_url":"https://github.com/vokal/XcodeAutoBasher.git","svn_url":"https://github.com/vokal/XcodeAutoBasher","homepage":null,"size":478,"stargazers_count":11,"watchers_count":11,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vokal/XcodeAutoBasher/pulls/13"},"html":{"href":"https://github.com/vokal/XcodeAutoBasher/pull/13"},"issue":{"href":"https://api.github.com/repos/vokal/XcodeAutoBasher/issues/13"},"comments":{"href":"https://api.github.com/repos/vokal/XcodeAutoBasher/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/vokal/XcodeAutoBasher/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/vokal/XcodeAutoBasher/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vokal/XcodeAutoBasher/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/vokal/XcodeAutoBasher/statuses/f9a17e27a77925ff96d85108330e2f4c6e776e74"}}}}