{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/cargo/pulls/comments/38377295","id":38377295,"diff_hunk":"@@ -35,7 +36,16 @@ pub fn execute(args: Flags, config: &Config) -> CliResult<Option<Error>> {\n     try!(config.shell().set_color_config(args.flag_color.as_ref().map(|s| &s[..])));\n \n     let mut contents = String::new();\n-    let file = File::open(&args.flag_manifest_path);\n+    let filename = args.flag_manifest_path.unwrap_or(\"Cargo.toml\".into());\n+\n+    if !filename.ends_with(\"Cargo.toml\") {\n+        fail(\"invalid\", \"the manifest-path must be a path to a Cargo.toml file\")\n+    }\n+    if !fs::metadata(&filename).is_ok() {\n+        fail(\"invalid\", &format!(\"manifest path `{}` does not exist\", filename))\n+    }","path":"src/bin/verify_project.rs","position":36,"original_position":36,"commit_id":"4c12d396e91a7e777ae69264151064bdd348cf52","original_commit_id":"4c12d396e91a7e777ae69264151064bdd348cf52","user":{"login":"carols10cents","id":193874,"avatar_url":"https://avatars.githubusercontent.com/u/193874?v=3","gravatar_id":"","url":"https://api.github.com/users/carols10cents","html_url":"https://github.com/carols10cents","followers_url":"https://api.github.com/users/carols10cents/followers","following_url":"https://api.github.com/users/carols10cents/following{/other_user}","gists_url":"https://api.github.com/users/carols10cents/gists{/gist_id}","starred_url":"https://api.github.com/users/carols10cents/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carols10cents/subscriptions","organizations_url":"https://api.github.com/users/carols10cents/orgs","repos_url":"https://api.github.com/users/carols10cents/repos","events_url":"https://api.github.com/users/carols10cents/events{/privacy}","received_events_url":"https://api.github.com/users/carols10cents/received_events","type":"User","site_admin":false},"body":"Oh! Totally!","created_at":"2015-09-01T01:05:27Z","updated_at":"2015-09-01T01:05:27Z","html_url":"https://github.com/rust-lang/cargo/pull/1955#discussion_r38377295","pull_request_url":"https://api.github.com/repos/rust-lang/cargo/pulls/1955","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/comments/38377295"},"html":{"href":"https://github.com/rust-lang/cargo/pull/1955#discussion_r38377295"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/1955"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/cargo/pulls/1955","id":43706777,"html_url":"https://github.com/rust-lang/cargo/pull/1955","diff_url":"https://github.com/rust-lang/cargo/pull/1955.diff","patch_url":"https://github.com/rust-lang/cargo/pull/1955.patch","issue_url":"https://api.github.com/repos/rust-lang/cargo/issues/1955","number":1955,"state":"open","locked":false,"title":"Even more manifest path consistency","user":{"login":"carols10cents","id":193874,"avatar_url":"https://avatars.githubusercontent.com/u/193874?v=3","gravatar_id":"","url":"https://api.github.com/users/carols10cents","html_url":"https://github.com/carols10cents","followers_url":"https://api.github.com/users/carols10cents/followers","following_url":"https://api.github.com/users/carols10cents/following{/other_user}","gists_url":"https://api.github.com/users/carols10cents/gists{/gist_id}","starred_url":"https://api.github.com/users/carols10cents/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carols10cents/subscriptions","organizations_url":"https://api.github.com/users/carols10cents/orgs","repos_url":"https://api.github.com/users/carols10cents/repos","events_url":"https://api.github.com/users/carols10cents/events{/privacy}","received_events_url":"https://api.github.com/users/carols10cents/received_events","type":"User","site_admin":false},"body":"Hiii :) This builds on #1953, so if yinz like this better, I'll close that one.\r\n\r\nThis PR makes all commands that take `--manifest-path` (except locate-project, see below) behave in a consistent way with regards to invalid paths, and hopefully gives better error messages.\r\n\r\nThis DOES break some instances where commands were \"working\", ie, completing their command successfully, with some path that they decided was right, not necessarily exactly the path that was passed in though. I'm not sure how this impacts whatever backwards compatibility guarantees cargo has. Given that those cases weren't using a valid path to an existing Cargo.toml, hopefully no one is relying on that behavior?\r\n\r\nSo locate-project... I'm not sure what to do about that one, exactly... If we define `--manifest-path` as a path to a Cargo.toml, then uhhhh we've located the project, it's right where you told us it is ;) So I think we should change it to be `--search-path` or similar? I'm too sleepy to take care of that tonight, so I just left it out of the manifest path tests.","created_at":"2015-08-30T03:27:52Z","updated_at":"2015-09-01T01:05:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a37d1fc887ff5b101e39c2b1cb9af7b7e1d62a5","assignee":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/cargo/pulls/1955/commits","review_comments_url":"https://api.github.com/repos/rust-lang/cargo/pulls/1955/comments","review_comment_url":"https://api.github.com/repos/rust-lang/cargo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang/cargo/issues/1955/comments","statuses_url":"https://api.github.com/repos/rust-lang/cargo/statuses/4c12d396e91a7e777ae69264151064bdd348cf52","head":{"label":"carols10cents:even-more-manifest-path-consistency","ref":"even-more-manifest-path-consistency","sha":"4c12d396e91a7e777ae69264151064bdd348cf52","user":{"login":"carols10cents","id":193874,"avatar_url":"https://avatars.githubusercontent.com/u/193874?v=3","gravatar_id":"","url":"https://api.github.com/users/carols10cents","html_url":"https://github.com/carols10cents","followers_url":"https://api.github.com/users/carols10cents/followers","following_url":"https://api.github.com/users/carols10cents/following{/other_user}","gists_url":"https://api.github.com/users/carols10cents/gists{/gist_id}","starred_url":"https://api.github.com/users/carols10cents/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carols10cents/subscriptions","organizations_url":"https://api.github.com/users/carols10cents/orgs","repos_url":"https://api.github.com/users/carols10cents/repos","events_url":"https://api.github.com/users/carols10cents/events{/privacy}","received_events_url":"https://api.github.com/users/carols10cents/received_events","type":"User","site_admin":false},"repo":{"id":24034128,"name":"cargo","full_name":"carols10cents/cargo","owner":{"login":"carols10cents","id":193874,"avatar_url":"https://avatars.githubusercontent.com/u/193874?v=3","gravatar_id":"","url":"https://api.github.com/users/carols10cents","html_url":"https://github.com/carols10cents","followers_url":"https://api.github.com/users/carols10cents/followers","following_url":"https://api.github.com/users/carols10cents/following{/other_user}","gists_url":"https://api.github.com/users/carols10cents/gists{/gist_id}","starred_url":"https://api.github.com/users/carols10cents/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carols10cents/subscriptions","organizations_url":"https://api.github.com/users/carols10cents/orgs","repos_url":"https://api.github.com/users/carols10cents/repos","events_url":"https://api.github.com/users/carols10cents/events{/privacy}","received_events_url":"https://api.github.com/users/carols10cents/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/carols10cents/cargo","description":"The Rust package manager","fork":true,"url":"https://api.github.com/repos/carols10cents/cargo","forks_url":"https://api.github.com/repos/carols10cents/cargo/forks","keys_url":"https://api.github.com/repos/carols10cents/cargo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/carols10cents/cargo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/carols10cents/cargo/teams","hooks_url":"https://api.github.com/repos/carols10cents/cargo/hooks","issue_events_url":"https://api.github.com/repos/carols10cents/cargo/issues/events{/number}","events_url":"https://api.github.com/repos/carols10cents/cargo/events","assignees_url":"https://api.github.com/repos/carols10cents/cargo/assignees{/user}","branches_url":"https://api.github.com/repos/carols10cents/cargo/branches{/branch}","tags_url":"https://api.github.com/repos/carols10cents/cargo/tags","blobs_url":"https://api.github.com/repos/carols10cents/cargo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/carols10cents/cargo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/carols10cents/cargo/git/refs{/sha}","trees_url":"https://api.github.com/repos/carols10cents/cargo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/carols10cents/cargo/statuses/{sha}","languages_url":"https://api.github.com/repos/carols10cents/cargo/languages","stargazers_url":"https://api.github.com/repos/carols10cents/cargo/stargazers","contributors_url":"https://api.github.com/repos/carols10cents/cargo/contributors","subscribers_url":"https://api.github.com/repos/carols10cents/cargo/subscribers","subscription_url":"https://api.github.com/repos/carols10cents/cargo/subscription","commits_url":"https://api.github.com/repos/carols10cents/cargo/commits{/sha}","git_commits_url":"https://api.github.com/repos/carols10cents/cargo/git/commits{/sha}","comments_url":"https://api.github.com/repos/carols10cents/cargo/comments{/number}","issue_comment_url":"https://api.github.com/repos/carols10cents/cargo/issues/comments{/number}","contents_url":"https://api.github.com/repos/carols10cents/cargo/contents/{+path}","compare_url":"https://api.github.com/repos/carols10cents/cargo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/carols10cents/cargo/merges","archive_url":"https://api.github.com/repos/carols10cents/cargo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/carols10cents/cargo/downloads","issues_url":"https://api.github.com/repos/carols10cents/cargo/issues{/number}","pulls_url":"https://api.github.com/repos/carols10cents/cargo/pulls{/number}","milestones_url":"https://api.github.com/repos/carols10cents/cargo/milestones{/number}","notifications_url":"https://api.github.com/repos/carols10cents/cargo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/carols10cents/cargo/labels{/name}","releases_url":"https://api.github.com/repos/carols10cents/cargo/releases{/id}","created_at":"2014-09-14T21:40:44Z","updated_at":"2014-09-14T10:29:32Z","pushed_at":"2015-08-30T03:19:49Z","git_url":"git://github.com/carols10cents/cargo.git","ssh_url":"git@github.com:carols10cents/cargo.git","clone_url":"https://github.com/carols10cents/cargo.git","svn_url":"https://github.com/carols10cents/cargo","homepage":"http://crates.io/","size":3753,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"1d0823b35e5bb593416b643575ad197c98c831d4","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":17420913,"name":"cargo","full_name":"rust-lang/cargo","owner":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang/cargo","description":"The Rust package manager","fork":false,"url":"https://api.github.com/repos/rust-lang/cargo","forks_url":"https://api.github.com/repos/rust-lang/cargo/forks","keys_url":"https://api.github.com/repos/rust-lang/cargo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/cargo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/cargo/teams","hooks_url":"https://api.github.com/repos/rust-lang/cargo/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/cargo/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/cargo/events","assignees_url":"https://api.github.com/repos/rust-lang/cargo/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/cargo/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/cargo/tags","blobs_url":"https://api.github.com/repos/rust-lang/cargo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/cargo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/cargo/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/cargo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/cargo/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/cargo/languages","stargazers_url":"https://api.github.com/repos/rust-lang/cargo/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/cargo/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/cargo/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/cargo/subscription","commits_url":"https://api.github.com/repos/rust-lang/cargo/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/cargo/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/cargo/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/cargo/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang/cargo/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/cargo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/cargo/merges","archive_url":"https://api.github.com/repos/rust-lang/cargo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/cargo/downloads","issues_url":"https://api.github.com/repos/rust-lang/cargo/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/cargo/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/cargo/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/cargo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/cargo/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/cargo/releases{/id}","created_at":"2014-03-04T23:20:42Z","updated_at":"2015-08-31T20:34:29Z","pushed_at":"2015-08-31T23:40:07Z","git_url":"git://github.com/rust-lang/cargo.git","ssh_url":"git@github.com:rust-lang/cargo.git","clone_url":"https://github.com/rust-lang/cargo.git","svn_url":"https://github.com/rust-lang/cargo","homepage":"http://crates.io/","size":27722,"stargazers_count":1272,"watchers_count":1272,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":283,"mirror_url":null,"open_issues_count":183,"forks":283,"open_issues":183,"watchers":1272,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/1955"},"html":{"href":"https://github.com/rust-lang/cargo/pull/1955"},"issue":{"href":"https://api.github.com/repos/rust-lang/cargo/issues/1955"},"comments":{"href":"https://api.github.com/repos/rust-lang/cargo/issues/1955/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/1955/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/1955/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/cargo/statuses/4c12d396e91a7e777ae69264151064bdd348cf52"}}}}