{"action":"created","comment":{"url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/pulls/comments/89816825","pull_request_review_id":10339712,"id":89816825,"diff_hunk":"@@ -244,6 +256,62 @@ spaceship_ruby_version() {\n   echo -n \"%{$reset_color%}\"\n }\n \n+# Swift\n+# Show current version of Swift\n+spaceship_swift_version() {\n+\n+  if [[ $SPACESHIP_SWIFT_SHOW_GLOBAL == true ]] ; then\n+    if command -v swiftenv > /dev/null 2>&1; then\n+      local swift_version=$(swiftenv version | sed 's/ .*//')\n+    fi\n+  elif [[ $SPACESHIP_SWIFT_SHOW_LOCAL == true ]] ; then\n+    if command -v swiftenv > /dev/null 2>&1; then\n+      if swiftenv version | grep \".swift-version\" > /dev/null; then\n+        local swift_version=$(swiftenv version | sed 's/ .*//')\n+      fi\n+    fi\n+  fi\n+\n+  if [ -n \"${swift_version}\" ]; then\n+    echo -n \" %B${SPACESHIP_PREFIX_SWIFT}%b \"\n+    echo -n \"%{$fg_bold[yellow]%}\"\n+    echo -n \"${SPACESHIP_SWIFT_SYMBOL}  ${swift_version}\"\n+    echo -n \"%{$reset_color%}\"\n+  fi\n+}\n+\n+# Xcode\n+# Show current version of Xcode\n+spaceship_xcode_version() {\n+\n+  if [[ $SPACESHIP_SWIFT_SHOW_GLOBAL == true ]] ; then\n+    if command -v xcenv > /dev/null 2>&1; then","path":"spaceship.zsh","position":52,"original_position":52,"commit_id":"ddd0a6bde5c5f99260353c7b5a65c218fa02c17e","original_commit_id":"ddd0a6bde5c5f99260353c7b5a65c218fa02c17e","user":{"login":"denysdovhan","id":3459374,"avatar_url":"https://avatars.githubusercontent.com/u/3459374?v=3","gravatar_id":"","url":"https://api.github.com/users/denysdovhan","html_url":"https://github.com/denysdovhan","followers_url":"https://api.github.com/users/denysdovhan/followers","following_url":"https://api.github.com/users/denysdovhan/following{/other_user}","gists_url":"https://api.github.com/users/denysdovhan/gists{/gist_id}","starred_url":"https://api.github.com/users/denysdovhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denysdovhan/subscriptions","organizations_url":"https://api.github.com/users/denysdovhan/orgs","repos_url":"https://api.github.com/users/denysdovhan/repos","events_url":"https://api.github.com/users/denysdovhan/events{/privacy}","received_events_url":"https://api.github.com/users/denysdovhan/received_events","type":"User","site_admin":false},"body":"Here the same: just replace these duplicated conditional by single line on top of function:\r\n\r\n```zsh\r\ncommand -v xcenv > /dev/null 2>&1 || return\r\n```","created_at":"2016-11-28T16:22:14Z","updated_at":"2016-11-28T16:25:34Z","html_url":"https://github.com/denysdovhan/spaceship-zsh-theme/pull/40#discussion_r89816825","pull_request_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/pulls/comments/89816825"},"html":{"href":"https://github.com/denysdovhan/spaceship-zsh-theme/pull/40#discussion_r89816825"},"pull_request":{"href":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/pulls/40","id":93960812,"html_url":"https://github.com/denysdovhan/spaceship-zsh-theme/pull/40","diff_url":"https://github.com/denysdovhan/spaceship-zsh-theme/pull/40.diff","patch_url":"https://github.com/denysdovhan/spaceship-zsh-theme/pull/40.patch","issue_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/issues/40","number":40,"state":"open","locked":false,"title":"Add Swift and Xcode Version component","user":{"login":"PoissonBallon","id":8491808,"avatar_url":"https://avatars.githubusercontent.com/u/8491808?v=3","gravatar_id":"","url":"https://api.github.com/users/PoissonBallon","html_url":"https://github.com/PoissonBallon","followers_url":"https://api.github.com/users/PoissonBallon/followers","following_url":"https://api.github.com/users/PoissonBallon/following{/other_user}","gists_url":"https://api.github.com/users/PoissonBallon/gists{/gist_id}","starred_url":"https://api.github.com/users/PoissonBallon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PoissonBallon/subscriptions","organizations_url":"https://api.github.com/users/PoissonBallon/orgs","repos_url":"https://api.github.com/users/PoissonBallon/repos","events_url":"https://api.github.com/users/PoissonBallon/events{/privacy}","received_events_url":"https://api.github.com/users/PoissonBallon/received_events","type":"User","site_admin":false},"body":"Add Swift version, through swiftenv (🐦).\r\nAdd Xcode version, through xcode-select (🛠).","created_at":"2016-11-16T12:57:53Z","updated_at":"2016-11-28T16:25:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e826c2315aa8b32bf78f5158f55506f1a23a83fa","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/pulls/40/commits","review_comments_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/pulls/40/comments","review_comment_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/pulls/comments{/number}","comments_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/issues/40/comments","statuses_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/statuses/ddd0a6bde5c5f99260353c7b5a65c218fa02c17e","head":{"label":"PoissonBallon:master","ref":"master","sha":"ddd0a6bde5c5f99260353c7b5a65c218fa02c17e","user":{"login":"PoissonBallon","id":8491808,"avatar_url":"https://avatars.githubusercontent.com/u/8491808?v=3","gravatar_id":"","url":"https://api.github.com/users/PoissonBallon","html_url":"https://github.com/PoissonBallon","followers_url":"https://api.github.com/users/PoissonBallon/followers","following_url":"https://api.github.com/users/PoissonBallon/following{/other_user}","gists_url":"https://api.github.com/users/PoissonBallon/gists{/gist_id}","starred_url":"https://api.github.com/users/PoissonBallon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PoissonBallon/subscriptions","organizations_url":"https://api.github.com/users/PoissonBallon/orgs","repos_url":"https://api.github.com/users/PoissonBallon/repos","events_url":"https://api.github.com/users/PoissonBallon/events{/privacy}","received_events_url":"https://api.github.com/users/PoissonBallon/received_events","type":"User","site_admin":false},"repo":{"id":73903929,"name":"spaceship-zsh-theme","full_name":"PoissonBallon/spaceship-zsh-theme","owner":{"login":"PoissonBallon","id":8491808,"avatar_url":"https://avatars.githubusercontent.com/u/8491808?v=3","gravatar_id":"","url":"https://api.github.com/users/PoissonBallon","html_url":"https://github.com/PoissonBallon","followers_url":"https://api.github.com/users/PoissonBallon/followers","following_url":"https://api.github.com/users/PoissonBallon/following{/other_user}","gists_url":"https://api.github.com/users/PoissonBallon/gists{/gist_id}","starred_url":"https://api.github.com/users/PoissonBallon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PoissonBallon/subscriptions","organizations_url":"https://api.github.com/users/PoissonBallon/orgs","repos_url":"https://api.github.com/users/PoissonBallon/repos","events_url":"https://api.github.com/users/PoissonBallon/events{/privacy}","received_events_url":"https://api.github.com/users/PoissonBallon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PoissonBallon/spaceship-zsh-theme","description":":star: :rocket: An “Oh My ZSH!” theme for Astronauts.","fork":true,"url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme","forks_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/forks","keys_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/teams","hooks_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/hooks","issue_events_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/issues/events{/number}","events_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/events","assignees_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/assignees{/user}","branches_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/branches{/branch}","tags_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/tags","blobs_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/git/refs{/sha}","trees_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/statuses/{sha}","languages_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/languages","stargazers_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/stargazers","contributors_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/contributors","subscribers_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/subscribers","subscription_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/subscription","commits_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/commits{/sha}","git_commits_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/git/commits{/sha}","comments_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/comments{/number}","issue_comment_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/issues/comments{/number}","contents_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/contents/{+path}","compare_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/merges","archive_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/downloads","issues_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/issues{/number}","pulls_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/pulls{/number}","milestones_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/milestones{/number}","notifications_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/labels{/name}","releases_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/releases{/id}","deployments_url":"https://api.github.com/repos/PoissonBallon/spaceship-zsh-theme/deployments","created_at":"2016-11-16T09:22:03Z","updated_at":"2016-11-16T09:22:04Z","pushed_at":"2016-11-26T10:03:41Z","git_url":"git://github.com/PoissonBallon/spaceship-zsh-theme.git","ssh_url":"git@github.com:PoissonBallon/spaceship-zsh-theme.git","clone_url":"https://github.com/PoissonBallon/spaceship-zsh-theme.git","svn_url":"https://github.com/PoissonBallon/spaceship-zsh-theme","homepage":"https://git.io/spaceship","size":273,"stargazers_count":0,"watchers_count":0,"language":"Shell","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":"denysdovhan:master","ref":"master","sha":"974a7962a748c1257665e37ca0d9b4039d6be727","user":{"login":"denysdovhan","id":3459374,"avatar_url":"https://avatars.githubusercontent.com/u/3459374?v=3","gravatar_id":"","url":"https://api.github.com/users/denysdovhan","html_url":"https://github.com/denysdovhan","followers_url":"https://api.github.com/users/denysdovhan/followers","following_url":"https://api.github.com/users/denysdovhan/following{/other_user}","gists_url":"https://api.github.com/users/denysdovhan/gists{/gist_id}","starred_url":"https://api.github.com/users/denysdovhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denysdovhan/subscriptions","organizations_url":"https://api.github.com/users/denysdovhan/orgs","repos_url":"https://api.github.com/users/denysdovhan/repos","events_url":"https://api.github.com/users/denysdovhan/events{/privacy}","received_events_url":"https://api.github.com/users/denysdovhan/received_events","type":"User","site_admin":false},"repo":{"id":50726688,"name":"spaceship-zsh-theme","full_name":"denysdovhan/spaceship-zsh-theme","owner":{"login":"denysdovhan","id":3459374,"avatar_url":"https://avatars.githubusercontent.com/u/3459374?v=3","gravatar_id":"","url":"https://api.github.com/users/denysdovhan","html_url":"https://github.com/denysdovhan","followers_url":"https://api.github.com/users/denysdovhan/followers","following_url":"https://api.github.com/users/denysdovhan/following{/other_user}","gists_url":"https://api.github.com/users/denysdovhan/gists{/gist_id}","starred_url":"https://api.github.com/users/denysdovhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denysdovhan/subscriptions","organizations_url":"https://api.github.com/users/denysdovhan/orgs","repos_url":"https://api.github.com/users/denysdovhan/repos","events_url":"https://api.github.com/users/denysdovhan/events{/privacy}","received_events_url":"https://api.github.com/users/denysdovhan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/denysdovhan/spaceship-zsh-theme","description":":star: :rocket: An “Oh My ZSH!” theme for Astronauts.","fork":false,"url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme","forks_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/forks","keys_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/keys{/key_id}","collaborators_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/teams","hooks_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/hooks","issue_events_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/issues/events{/number}","events_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/events","assignees_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/assignees{/user}","branches_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/branches{/branch}","tags_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/tags","blobs_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/git/refs{/sha}","trees_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/git/trees{/sha}","statuses_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/statuses/{sha}","languages_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/languages","stargazers_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/stargazers","contributors_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/contributors","subscribers_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/subscribers","subscription_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/subscription","commits_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/commits{/sha}","git_commits_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/git/commits{/sha}","comments_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/comments{/number}","issue_comment_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/issues/comments{/number}","contents_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/contents/{+path}","compare_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/compare/{base}...{head}","merges_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/merges","archive_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/downloads","issues_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/issues{/number}","pulls_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/pulls{/number}","milestones_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/milestones{/number}","notifications_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/labels{/name}","releases_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/releases{/id}","deployments_url":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/deployments","created_at":"2016-01-30T13:50:02Z","updated_at":"2016-11-28T15:07:25Z","pushed_at":"2016-11-26T10:03:41Z","git_url":"git://github.com/denysdovhan/spaceship-zsh-theme.git","ssh_url":"git@github.com:denysdovhan/spaceship-zsh-theme.git","clone_url":"https://github.com/denysdovhan/spaceship-zsh-theme.git","svn_url":"https://github.com/denysdovhan/spaceship-zsh-theme","homepage":"https://git.io/spaceship","size":279,"stargazers_count":198,"watchers_count":198,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":7,"forks":32,"open_issues":7,"watchers":198,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/pulls/40"},"html":{"href":"https://github.com/denysdovhan/spaceship-zsh-theme/pull/40"},"issue":{"href":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/issues/40"},"comments":{"href":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/denysdovhan/spaceship-zsh-theme/statuses/ddd0a6bde5c5f99260353c7b5a65c218fa02c17e"}}}}
{"actor":{"display_login":"denysdovhan"}}