{"action":"created","comment":{"url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/comments/52359299","id":52359299,"diff_hunk":"@@ -0,0 +1,139 @@\n+#!/bin/bash\n+\n+set -o errexit -o pipefail\n+\n+usage()\n+{ # Show usage information.\n+  echo \"$(basename \"$(test -L \"$0\" && readlink \"$0\" || echo \"$0\")\") <installation-path> <dcos-url> [--add-path yes/no]\"\n+}\n+\n+post_install_message()\n+{\n+    echo 'Finished installing and configuring DCOS CLI.'\n+    echo ''\n+    echo 'Run this command to set up your environment and to get started:'\n+    echo \"source $1 && dcos help\"\n+}\n+\n+RC_NAME=\"\"\n+\n+write_to_profile()\n+{\n+    echo \"\" >> ~/\"$2\";\n+    echo \"# path to the DCOS CLI binary\" >> ~/\"$2\";\n+    echo \"if [[ \\\"\\$PATH\\\" != *\\\"$1\\\"* ]];\" >> ~/\"$2\";\n+    echo \"  then export PATH=\\$PATH:$1;\" >> ~/\"$2\";\n+    echo \"fi\" >> ~/\"$2\";\n+}\n+\n+add_dcos_path_to_profile()\n+{\n+    UNAME=`uname`\n+    case \"$UNAME\" in\n+        Linux ) RC_NAME=\".bashrc\";;\n+        Darwin ) RC_NAME=\".bash_profile\";;\n+        CYGWIN* ) RC_NAME=\".bashrc\";;\n+        MINGW* ) RC_NAME=\".profile\";;\n+        * ) RC_NAME=\".bashrc\";;\n+    esac\n+    write_to_profile \"$1\" \"$RC_NAME\"\n+}\n+\n+prompt_add_dcos_path_to_profile()\n+{\n+    while true; do\n+        echo \"\"\n+        read -p \"Modify your bash profile to add DCOS to your PATH? [yes/no] \" ANSWER\n+        echo \"\"\n+        case \"$ANSWER\" in\n+            [Yy]* ) add_dcos_path_to_profile \"$1\"; break;;\n+            [Nn]* ) break;;\n+            * ) echo \"Please answer yes or no.\";;\n+        esac\n+    done\n+}\n+\n+check_pip_version()\n+{\n+    PIP_INFO=$(pip -V);\n+    REGEX=\"([0-9]+)\\.([0-9]+)\";\n+    [[ $PIP_INFO =~ $REGEX ]];\n+    MAJOR_PIP_VERSION=\"${BASH_REMATCH[1]}\";\n+    MINOR_PIP_VERSION=\"${BASH_REMATCH[2]}\";\n+    if [ \"$MAJOR_PIP_VERSION\" -lt 1 ] || ([ \"$MAJOR_PIP_VERSION\" -eq 1 ] && [ \"$MINOR_PIP_VERSION\" -le 4 ]);\n+        then echo \"Pip version must be greater than 1.4. Aborting.\";\n+        exit 1;\n+    fi\n+}\n+\n+if [ \"$#\" -lt 2 ]; then\n+  usage;\n+  exit 1;\n+fi\n+\n+check_pip_version;\n+\n+ARGS=( \"$@\" );\n+\n+VIRTUAL_ENV_PATH=$(python -c \"import os; print(os.path.realpath('\"${ARGS[0]}\"'))\")\n+if [[ $VIRTUAL_ENV_PATH =~ \\  ]];\n+\tthen echo \"Spaces are not permitted in the installation path. Please try again with another path.\";\n+    exit 1;\n+fi\n+DCOS_URL=${ARGS[1]}\n+\n+command -v virtualenv >/dev/null 2>&1 || { echo \"Cannot find virtualenv. You may need to install it by following the documentation at https://docs.mesosphere.com/install/cli/#linux. Aborting.\"; exit 1; }\n+\n+VIRTUALENV_VERSION=$(virtualenv --version)\n+VERSION_REGEX=\"s#[^0-9]*\\([0-9]*\\)[.]\\([0-9]*\\)[.]\\([0-9]*\\)\\([0-9A-Za-z-]*\\)#\\1#\"\n+\n+eval MAJOR=`echo $VIRTUALENV_VERSION | sed -e $VERSION_REGEX`\n+if [ $MAJOR -lt 12 ];\n+\tthen echo \"Virtualenv version must be 12 or greater. Aborting.\";\n+\texit 1;\n+fi\n+\n+echo \"Installing DCOS CLI from PyPI...\";\n+echo \"\";\n+\n+# Let's first setup a virtualenv: we are assuming that the path is absolute\n+mkdir -p \"$VIRTUAL_ENV_PATH\"\n+virtualenv \"$VIRTUAL_ENV_PATH\"\n+\n+# Install the DCOS CLI package, using version if set\n+if [ -z \"$DCOS_CLI_VERSION\" ]; then\n+    \"$VIRTUAL_ENV_PATH/bin/pip\" install --quiet \"dcoscli\"","path":"bin/install/legacy/install-legacy-optout-dcos-cli.sh","position":105,"original_position":105,"commit_id":"faa00244063d02f77bc7d8c6a37652c61dec6b0c","original_commit_id":"faa00244063d02f77bc7d8c6a37652c61dec6b0c","user":{"login":"tamarrow","id":1292768,"avatar_url":"https://avatars.githubusercontent.com/u/1292768?v=3","gravatar_id":"","url":"https://api.github.com/users/tamarrow","html_url":"https://github.com/tamarrow","followers_url":"https://api.github.com/users/tamarrow/followers","following_url":"https://api.github.com/users/tamarrow/following{/other_user}","gists_url":"https://api.github.com/users/tamarrow/gists{/gist_id}","starred_url":"https://api.github.com/users/tamarrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamarrow/subscriptions","organizations_url":"https://api.github.com/users/tamarrow/orgs","repos_url":"https://api.github.com/users/tamarrow/repos","events_url":"https://api.github.com/users/tamarrow/events{/privacy}","received_events_url":"https://api.github.com/users/tamarrow/received_events","type":"User","site_admin":false},"body":"updated here.","created_at":"2016-02-09T19:22:32Z","updated_at":"2016-02-09T19:22:32Z","html_url":"https://github.com/mesosphere/dcos-cli/pull/448#discussion_r52359299","pull_request_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/448","_links":{"self":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/comments/52359299"},"html":{"href":"https://github.com/mesosphere/dcos-cli/pull/448#discussion_r52359299"},"pull_request":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/448"}}},"pull_request":{"url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/448","id":58688228,"html_url":"https://github.com/mesosphere/dcos-cli/pull/448","diff_url":"https://github.com/mesosphere/dcos-cli/pull/448.diff","patch_url":"https://github.com/mesosphere/dcos-cli/pull/448.patch","issue_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/448","number":448,"state":"open","locked":false,"title":"remove package configuration from install script","user":{"login":"tamarrow","id":1292768,"avatar_url":"https://avatars.githubusercontent.com/u/1292768?v=3","gravatar_id":"","url":"https://api.github.com/users/tamarrow","html_url":"https://github.com/tamarrow","followers_url":"https://api.github.com/users/tamarrow/followers","following_url":"https://api.github.com/users/tamarrow/following{/other_user}","gists_url":"https://api.github.com/users/tamarrow/gists{/gist_id}","starred_url":"https://api.github.com/users/tamarrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamarrow/subscriptions","organizations_url":"https://api.github.com/users/tamarrow/orgs","repos_url":"https://api.github.com/users/tamarrow/repos","events_url":"https://api.github.com/users/tamarrow/events{/privacy}","received_events_url":"https://api.github.com/users/tamarrow/received_events","type":"User","site_admin":false},"body":"issue #446","created_at":"2016-02-09T00:15:17Z","updated_at":"2016-02-09T19:22:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"015ceaf69f7769f209cfca2e70f9d9961776389c","assignee":{"login":"jsancio","id":794394,"avatar_url":"https://avatars.githubusercontent.com/u/794394?v=3","gravatar_id":"","url":"https://api.github.com/users/jsancio","html_url":"https://github.com/jsancio","followers_url":"https://api.github.com/users/jsancio/followers","following_url":"https://api.github.com/users/jsancio/following{/other_user}","gists_url":"https://api.github.com/users/jsancio/gists{/gist_id}","starred_url":"https://api.github.com/users/jsancio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsancio/subscriptions","organizations_url":"https://api.github.com/users/jsancio/orgs","repos_url":"https://api.github.com/users/jsancio/repos","events_url":"https://api.github.com/users/jsancio/events{/privacy}","received_events_url":"https://api.github.com/users/jsancio/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/448/commits","review_comments_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/448/comments","review_comment_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/448/comments","statuses_url":"https://api.github.com/repos/mesosphere/dcos-cli/statuses/faa00244063d02f77bc7d8c6a37652c61dec6b0c","head":{"label":"mesosphere:installer-updates","ref":"installer-updates","sha":"faa00244063d02f77bc7d8c6a37652c61dec6b0c","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":26653348,"name":"dcos-cli","full_name":"mesosphere/dcos-cli","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/dcos-cli","description":"The command line for your datacenter! ","fork":false,"url":"https://api.github.com/repos/mesosphere/dcos-cli","forks_url":"https://api.github.com/repos/mesosphere/dcos-cli/forks","keys_url":"https://api.github.com/repos/mesosphere/dcos-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/dcos-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/dcos-cli/teams","hooks_url":"https://api.github.com/repos/mesosphere/dcos-cli/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/dcos-cli/events","assignees_url":"https://api.github.com/repos/mesosphere/dcos-cli/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/dcos-cli/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/dcos-cli/tags","blobs_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/dcos-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/dcos-cli/languages","stargazers_url":"https://api.github.com/repos/mesosphere/dcos-cli/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/dcos-cli/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/dcos-cli/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/dcos-cli/subscription","commits_url":"https://api.github.com/repos/mesosphere/dcos-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/dcos-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/dcos-cli/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/dcos-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/dcos-cli/merges","archive_url":"https://api.github.com/repos/mesosphere/dcos-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/dcos-cli/downloads","issues_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/dcos-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/dcos-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/dcos-cli/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/dcos-cli/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/dcos-cli/deployments","created_at":"2014-11-14T19:11:48Z","updated_at":"2016-02-03T11:24:32Z","pushed_at":"2016-02-09T18:31:46Z","git_url":"git://github.com/mesosphere/dcos-cli.git","ssh_url":"git@github.com:mesosphere/dcos-cli.git","clone_url":"https://github.com/mesosphere/dcos-cli.git","svn_url":"https://github.com/mesosphere/dcos-cli","homepage":"http://docs.mesosphere.com/using/cli/","size":2347,"stargazers_count":68,"watchers_count":68,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":18,"forks":24,"open_issues":18,"watchers":68,"default_branch":"master"}},"base":{"label":"mesosphere:cosmos","ref":"cosmos","sha":"f55099160932c66f43b218c5bbe6cc0a98902211","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":26653348,"name":"dcos-cli","full_name":"mesosphere/dcos-cli","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/dcos-cli","description":"The command line for your datacenter! ","fork":false,"url":"https://api.github.com/repos/mesosphere/dcos-cli","forks_url":"https://api.github.com/repos/mesosphere/dcos-cli/forks","keys_url":"https://api.github.com/repos/mesosphere/dcos-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/dcos-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/dcos-cli/teams","hooks_url":"https://api.github.com/repos/mesosphere/dcos-cli/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/dcos-cli/events","assignees_url":"https://api.github.com/repos/mesosphere/dcos-cli/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/dcos-cli/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/dcos-cli/tags","blobs_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/dcos-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/dcos-cli/languages","stargazers_url":"https://api.github.com/repos/mesosphere/dcos-cli/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/dcos-cli/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/dcos-cli/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/dcos-cli/subscription","commits_url":"https://api.github.com/repos/mesosphere/dcos-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/dcos-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/dcos-cli/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/dcos-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/dcos-cli/merges","archive_url":"https://api.github.com/repos/mesosphere/dcos-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/dcos-cli/downloads","issues_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/dcos-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/dcos-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/dcos-cli/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/dcos-cli/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/dcos-cli/deployments","created_at":"2014-11-14T19:11:48Z","updated_at":"2016-02-03T11:24:32Z","pushed_at":"2016-02-09T18:31:46Z","git_url":"git://github.com/mesosphere/dcos-cli.git","ssh_url":"git@github.com:mesosphere/dcos-cli.git","clone_url":"https://github.com/mesosphere/dcos-cli.git","svn_url":"https://github.com/mesosphere/dcos-cli","homepage":"http://docs.mesosphere.com/using/cli/","size":2347,"stargazers_count":68,"watchers_count":68,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":18,"forks":24,"open_issues":18,"watchers":68,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/448"},"html":{"href":"https://github.com/mesosphere/dcos-cli/pull/448"},"issue":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/issues/448"},"comments":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/issues/448/comments"},"review_comments":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/448/comments"},"review_comment":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/448/commits"},"statuses":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/statuses/faa00244063d02f77bc7d8c6a37652c61dec6b0c"}}}}