{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/cli/pulls/comments/170807209","pull_request_review_id":99549358,"id":170807209,"diff_hunk":"@@ -178,5 +202,30 @@ public override int Execute()\n                 return 1;\n             }\n         }\n+\n+        private int Validate()\n+        {\n+            if (_binPath != null && _global)\n+            {\n+                throw new GracefulException(\"Cannot have global and bin-path as opinion at the same time.\");\n+            }\n+\n+            if (_configFilePath != null && !File.Exists(_configFilePath))\n+            {\n+                throw new GracefulException(\n+                    string.Format(\n+                        LocalizableStrings.NuGetConfigurationFileDoesNotExist,\n+                        Path.GetFullPath(_configFilePath)));\n+            }\n+\n+            // Prevent installation if any version of the package is installed\n+            if (_toolPackageStore.GetInstalledPackages(_packageId).FirstOrDefault() != null)","path":"src/dotnet/commands/dotnet-install/dotnet-install-tool/InstallToolCommand.cs","position":169,"original_position":169,"commit_id":"999582f0987af9adeb9e7fa00c10fa52995a5a59","original_commit_id":"999582f0987af9adeb9e7fa00c10fa52995a5a59","user":{"login":"peterhuene","id":509666,"avatar_url":"https://avatars3.githubusercontent.com/u/509666?v=4","gravatar_id":"","url":"https://api.github.com/users/peterhuene","html_url":"https://github.com/peterhuene","followers_url":"https://api.github.com/users/peterhuene/followers","following_url":"https://api.github.com/users/peterhuene/following{/other_user}","gists_url":"https://api.github.com/users/peterhuene/gists{/gist_id}","starred_url":"https://api.github.com/users/peterhuene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterhuene/subscriptions","organizations_url":"https://api.github.com/users/peterhuene/orgs","repos_url":"https://api.github.com/users/peterhuene/repos","events_url":"https://api.github.com/users/peterhuene/events{/privacy}","received_events_url":"https://api.github.com/users/peterhuene/received_events","type":"User","site_admin":false},"body":"So we can't do `dotnet install foo` if a global tool called `foo` is already installed, correct?","created_at":"2018-02-27T03:34:12Z","updated_at":"2018-02-27T03:34:12Z","html_url":"https://github.com/dotnet/cli/pull/8670#discussion_r170807209","pull_request_url":"https://api.github.com/repos/dotnet/cli/pulls/8670","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/cli/pulls/comments/170807209"},"html":{"href":"https://github.com/dotnet/cli/pull/8670#discussion_r170807209"},"pull_request":{"href":"https://api.github.com/repos/dotnet/cli/pulls/8670"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/cli/pulls/8670","id":170908849,"html_url":"https://github.com/dotnet/cli/pull/8670","diff_url":"https://github.com/dotnet/cli/pull/8670.diff","patch_url":"https://github.com/dotnet/cli/pull/8670.patch","issue_url":"https://api.github.com/repos/dotnet/cli/issues/8670","number":8670,"state":"open","locked":false,"title":"WIP for discussion session tools","user":{"login":"wli3","id":6993335,"avatar_url":"https://avatars1.githubusercontent.com/u/6993335?v=4","gravatar_id":"","url":"https://api.github.com/users/wli3","html_url":"https://github.com/wli3","followers_url":"https://api.github.com/users/wli3/followers","following_url":"https://api.github.com/users/wli3/following{/other_user}","gists_url":"https://api.github.com/users/wli3/gists{/gist_id}","starred_url":"https://api.github.com/users/wli3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wli3/subscriptions","organizations_url":"https://api.github.com/users/wli3/orgs","repos_url":"https://api.github.com/users/wli3/repos","events_url":"https://api.github.com/users/wli3/events{/privacy}","received_events_url":"https://api.github.com/users/wli3/received_events","type":"User","site_admin":false},"body":"Here is example bat script\r\n\r\n```bat\r\nSET binpath=c:\\work\\cli\\bin\\binpath%RANDOM% :: it is different every time the script runs\r\nSET PATH=%PATH%;%binpath%\r\ndotnet install tool dotnet-sql-cache --bin-path %binpath% --version 2.1.0-preview1-28181\r\ndotnet sql-cache -v\r\n```\r\n\r\n@KathleenDollard \r\n\r\n1. is the experience good? \r\n2. is `--bin-path` a good name for location of the shim? I choose bin path because of `/usr/bin` directory and it is a path. Meanwhile I don't think _shim_ is a good term for user facing. It is too board.\r\n3. It is worth to always override shim instead of error out? We push binpath location to the user anyway, they can make sure it is empty. Or we need to diverge the code for global vs non global more and likely to introduce more bug.\r\n\r\nPending:\r\n1. More refactoring to get rid of the so many if else\r\n2. loc","created_at":"2018-02-23T01:05:23Z","updated_at":"2018-02-27T03:34:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2397c2dcd166e5a2c32fef5238d81a7e9ca8b044","assignee":null,"assignees":[],"requested_reviewers":[{"login":"livarcocc","id":367554,"avatar_url":"https://avatars3.githubusercontent.com/u/367554?v=4","gravatar_id":"","url":"https://api.github.com/users/livarcocc","html_url":"https://github.com/livarcocc","followers_url":"https://api.github.com/users/livarcocc/followers","following_url":"https://api.github.com/users/livarcocc/following{/other_user}","gists_url":"https://api.github.com/users/livarcocc/gists{/gist_id}","starred_url":"https://api.github.com/users/livarcocc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/livarcocc/subscriptions","organizations_url":"https://api.github.com/users/livarcocc/orgs","repos_url":"https://api.github.com/users/livarcocc/repos","events_url":"https://api.github.com/users/livarcocc/events{/privacy}","received_events_url":"https://api.github.com/users/livarcocc/received_events","type":"User","site_admin":false},{"login":"KathleenDollard","id":5844318,"avatar_url":"https://avatars2.githubusercontent.com/u/5844318?v=4","gravatar_id":"","url":"https://api.github.com/users/KathleenDollard","html_url":"https://github.com/KathleenDollard","followers_url":"https://api.github.com/users/KathleenDollard/followers","following_url":"https://api.github.com/users/KathleenDollard/following{/other_user}","gists_url":"https://api.github.com/users/KathleenDollard/gists{/gist_id}","starred_url":"https://api.github.com/users/KathleenDollard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KathleenDollard/subscriptions","organizations_url":"https://api.github.com/users/KathleenDollard/orgs","repos_url":"https://api.github.com/users/KathleenDollard/repos","events_url":"https://api.github.com/users/KathleenDollard/events{/privacy}","received_events_url":"https://api.github.com/users/KathleenDollard/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/cli/pulls/8670/commits","review_comments_url":"https://api.github.com/repos/dotnet/cli/pulls/8670/comments","review_comment_url":"https://api.github.com/repos/dotnet/cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/cli/issues/8670/comments","statuses_url":"https://api.github.com/repos/dotnet/cli/statuses/999582f0987af9adeb9e7fa00c10fa52995a5a59","head":{"label":"wli3:session-tool-rebase-3","ref":"session-tool-rebase-3","sha":"999582f0987af9adeb9e7fa00c10fa52995a5a59","user":{"login":"wli3","id":6993335,"avatar_url":"https://avatars1.githubusercontent.com/u/6993335?v=4","gravatar_id":"","url":"https://api.github.com/users/wli3","html_url":"https://github.com/wli3","followers_url":"https://api.github.com/users/wli3/followers","following_url":"https://api.github.com/users/wli3/following{/other_user}","gists_url":"https://api.github.com/users/wli3/gists{/gist_id}","starred_url":"https://api.github.com/users/wli3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wli3/subscriptions","organizations_url":"https://api.github.com/users/wli3/orgs","repos_url":"https://api.github.com/users/wli3/repos","events_url":"https://api.github.com/users/wli3/events{/privacy}","received_events_url":"https://api.github.com/users/wli3/received_events","type":"User","site_admin":false},"repo":{"id":67354897,"name":"cli","full_name":"wli3/cli","owner":{"login":"wli3","id":6993335,"avatar_url":"https://avatars1.githubusercontent.com/u/6993335?v=4","gravatar_id":"","url":"https://api.github.com/users/wli3","html_url":"https://github.com/wli3","followers_url":"https://api.github.com/users/wli3/followers","following_url":"https://api.github.com/users/wli3/following{/other_user}","gists_url":"https://api.github.com/users/wli3/gists{/gist_id}","starred_url":"https://api.github.com/users/wli3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wli3/subscriptions","organizations_url":"https://api.github.com/users/wli3/orgs","repos_url":"https://api.github.com/users/wli3/repos","events_url":"https://api.github.com/users/wli3/events{/privacy}","received_events_url":"https://api.github.com/users/wli3/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wli3/cli","description":"This repo contains the .NET Core command-line (CLI) tools, used for building .NET Core apps and libraries through your development flow (compiling, NuGet package management, running, testing, ...).","fork":true,"url":"https://api.github.com/repos/wli3/cli","forks_url":"https://api.github.com/repos/wli3/cli/forks","keys_url":"https://api.github.com/repos/wli3/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wli3/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wli3/cli/teams","hooks_url":"https://api.github.com/repos/wli3/cli/hooks","issue_events_url":"https://api.github.com/repos/wli3/cli/issues/events{/number}","events_url":"https://api.github.com/repos/wli3/cli/events","assignees_url":"https://api.github.com/repos/wli3/cli/assignees{/user}","branches_url":"https://api.github.com/repos/wli3/cli/branches{/branch}","tags_url":"https://api.github.com/repos/wli3/cli/tags","blobs_url":"https://api.github.com/repos/wli3/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wli3/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wli3/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/wli3/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wli3/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/wli3/cli/languages","stargazers_url":"https://api.github.com/repos/wli3/cli/stargazers","contributors_url":"https://api.github.com/repos/wli3/cli/contributors","subscribers_url":"https://api.github.com/repos/wli3/cli/subscribers","subscription_url":"https://api.github.com/repos/wli3/cli/subscription","commits_url":"https://api.github.com/repos/wli3/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/wli3/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/wli3/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/wli3/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/wli3/cli/contents/{+path}","compare_url":"https://api.github.com/repos/wli3/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wli3/cli/merges","archive_url":"https://api.github.com/repos/wli3/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wli3/cli/downloads","issues_url":"https://api.github.com/repos/wli3/cli/issues{/number}","pulls_url":"https://api.github.com/repos/wli3/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/wli3/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/wli3/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wli3/cli/labels{/name}","releases_url":"https://api.github.com/repos/wli3/cli/releases{/id}","deployments_url":"https://api.github.com/repos/wli3/cli/deployments","created_at":"2016-09-04T16:06:24Z","updated_at":"2016-09-04T16:06:28Z","pushed_at":"2018-02-26T23:51:16Z","git_url":"git://github.com/wli3/cli.git","ssh_url":"git@github.com:wli3/cli.git","clone_url":"https://github.com/wli3/cli.git","svn_url":"https://github.com/wli3/cli","homepage":"https://docs.microsoft.com/dotnet/ ","size":38415,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"rel/1.0.0"}},"base":{"label":"dotnet:master","ref":"master","sha":"94fd3fd392a0199cefec41cf2684dec4dbb673c2","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":43568107,"name":"cli","full_name":"dotnet/cli","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/cli","description":"This repo contains the .NET Core command-line (CLI) tools, used for building .NET Core apps and libraries through your development flow (compiling, NuGet package management, running, testing, ...).","fork":false,"url":"https://api.github.com/repos/dotnet/cli","forks_url":"https://api.github.com/repos/dotnet/cli/forks","keys_url":"https://api.github.com/repos/dotnet/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/cli/teams","hooks_url":"https://api.github.com/repos/dotnet/cli/hooks","issue_events_url":"https://api.github.com/repos/dotnet/cli/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/cli/events","assignees_url":"https://api.github.com/repos/dotnet/cli/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/cli/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/cli/tags","blobs_url":"https://api.github.com/repos/dotnet/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/cli/languages","stargazers_url":"https://api.github.com/repos/dotnet/cli/stargazers","contributors_url":"https://api.github.com/repos/dotnet/cli/contributors","subscribers_url":"https://api.github.com/repos/dotnet/cli/subscribers","subscription_url":"https://api.github.com/repos/dotnet/cli/subscription","commits_url":"https://api.github.com/repos/dotnet/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/cli/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/cli/merges","archive_url":"https://api.github.com/repos/dotnet/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/cli/downloads","issues_url":"https://api.github.com/repos/dotnet/cli/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/cli/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/cli/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/cli/deployments","created_at":"2015-10-02T18:03:15Z","updated_at":"2018-02-27T02:19:02Z","pushed_at":"2018-02-27T02:54:27Z","git_url":"git://github.com/dotnet/cli.git","ssh_url":"git@github.com:dotnet/cli.git","clone_url":"https://github.com/dotnet/cli.git","svn_url":"https://github.com/dotnet/cli","homepage":"https://github.com/dotnet/core","size":37598,"stargazers_count":2576,"watchers_count":2576,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":821,"mirror_url":null,"archived":false,"open_issues_count":450,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":821,"open_issues":450,"watchers":2576,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/cli/pulls/8670"},"html":{"href":"https://github.com/dotnet/cli/pull/8670"},"issue":{"href":"https://api.github.com/repos/dotnet/cli/issues/8670"},"comments":{"href":"https://api.github.com/repos/dotnet/cli/issues/8670/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/cli/pulls/8670/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/cli/pulls/8670/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/cli/statuses/999582f0987af9adeb9e7fa00c10fa52995a5a59"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"peterhuene"}}