{"action":"created","comment":{"url":"https://api.github.com/repos/fnproject/cli/pulls/comments/185661387","pull_request_review_id":117096177,"id":185661387,"diff_hunk":"@@ -229,18 +233,26 @@ func list(c *cli.Context) error {\n \treturn w.Flush()\n }\n \n-func createFilePath(filename string) (string, error) {\n-\tcontextFileName := filename + \".yaml\"\n-\thome := config.GetHomeDir()\n-\tpath := filepath.Join(home, contextsPath, contextFileName)\n-\treturn path, nil\n+func (ctxMap *ContextMap) updateCtx(c *cli.Context) error {\n+\tkey := c.Args().Get(0)\n+\tvalue := c.Args().Get(1)\n+\terr := ctxMap.Set(key, value)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\n+\tfmt.Printf(\"Successfully set %v: %v \\n\", key, value)\n+\treturn nil\n+}\n+\n+func createFilePath(filename string) string {\n+\thome := utils.GetHomeDir()\n+\tpath := filepath.Join(home, contextsPath, filename)\n+\treturn path\n }\n \n func checkContextFileExists(filename string) (bool, error) {\n-\tpath, err := createFilePath(filename)\n-\tif err != nil {\n-\t\treturn false, err\n-\t}\n+\tpath := createFilePath(filename + \".yaml\")","path":"context.go","position":221,"original_position":221,"commit_id":"abf97f94c60fff9d7c594bd14fedf4fb41f9f160","original_commit_id":"abf97f94c60fff9d7c594bd14fedf4fb41f9f160","user":{"login":"denismakogon","id":3034091,"avatar_url":"https://avatars1.githubusercontent.com/u/3034091?v=4","gravatar_id":"","url":"https://api.github.com/users/denismakogon","html_url":"https://github.com/denismakogon","followers_url":"https://api.github.com/users/denismakogon/followers","following_url":"https://api.github.com/users/denismakogon/following{/other_user}","gists_url":"https://api.github.com/users/denismakogon/gists{/gist_id}","starred_url":"https://api.github.com/users/denismakogon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denismakogon/subscriptions","organizations_url":"https://api.github.com/users/denismakogon/orgs","repos_url":"https://api.github.com/users/denismakogon/repos","events_url":"https://api.github.com/users/denismakogon/events{/privacy}","received_events_url":"https://api.github.com/users/denismakogon/received_events","type":"User","site_admin":false},"body":"so, we enforce to have `*.yaml` only, what about `*.yml`? just out of curiour","created_at":"2018-05-02T22:49:57Z","updated_at":"2018-05-02T22:49:57Z","html_url":"https://github.com/fnproject/cli/pull/261#discussion_r185661387","pull_request_url":"https://api.github.com/repos/fnproject/cli/pulls/261","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/fnproject/cli/pulls/comments/185661387"},"html":{"href":"https://github.com/fnproject/cli/pull/261#discussion_r185661387"},"pull_request":{"href":"https://api.github.com/repos/fnproject/cli/pulls/261"}}},"pull_request":{"url":"https://api.github.com/repos/fnproject/cli/pulls/261","id":185518098,"html_url":"https://github.com/fnproject/cli/pull/261","diff_url":"https://github.com/fnproject/cli/pull/261.diff","patch_url":"https://github.com/fnproject/cli/pull/261.patch","issue_url":"https://api.github.com/repos/fnproject/cli/issues/261","number":261,"state":"open","locked":false,"title":"Update context command to edit current context files. ","user":{"login":"JadeRedworth","id":25709275,"avatar_url":"https://avatars2.githubusercontent.com/u/25709275?v=4","gravatar_id":"","url":"https://api.github.com/users/JadeRedworth","html_url":"https://github.com/JadeRedworth","followers_url":"https://api.github.com/users/JadeRedworth/followers","following_url":"https://api.github.com/users/JadeRedworth/following{/other_user}","gists_url":"https://api.github.com/users/JadeRedworth/gists{/gist_id}","starred_url":"https://api.github.com/users/JadeRedworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JadeRedworth/subscriptions","organizations_url":"https://api.github.com/users/JadeRedworth/orgs","repos_url":"https://api.github.com/users/JadeRedworth/repos","events_url":"https://api.github.com/users/JadeRedworth/events{/privacy}","received_events_url":"https://api.github.com/users/JadeRedworth/received_events","type":"User","site_admin":false},"body":"The sectoin of issue: [#217](https://github.com/fnproject/cli/issues/217)\r\n\r\nThe update command reads in the `current-context` file and identifies if the <key> provided by the user is valid within the file. If so updates the <value>, if not a new key/value pair is added.\r\n\r\nAdded validation for `api-url` when creating and updating and added tests for this validation.\r\n\r\nAlso some general code tidy up/refactoring within the context command file.\r\n","created_at":"2018-05-02T18:08:50Z","updated_at":"2018-05-02T22:49:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6aeb0a2788bffe333ddbf34d57ec10d381e4e254","assignee":null,"assignees":[],"requested_reviewers":[{"login":"rikgibson","id":16211574,"avatar_url":"https://avatars3.githubusercontent.com/u/16211574?v=4","gravatar_id":"","url":"https://api.github.com/users/rikgibson","html_url":"https://github.com/rikgibson","followers_url":"https://api.github.com/users/rikgibson/followers","following_url":"https://api.github.com/users/rikgibson/following{/other_user}","gists_url":"https://api.github.com/users/rikgibson/gists{/gist_id}","starred_url":"https://api.github.com/users/rikgibson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rikgibson/subscriptions","organizations_url":"https://api.github.com/users/rikgibson/orgs","repos_url":"https://api.github.com/users/rikgibson/repos","events_url":"https://api.github.com/users/rikgibson/events{/privacy}","received_events_url":"https://api.github.com/users/rikgibson/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/fnproject/cli/pulls/261/commits","review_comments_url":"https://api.github.com/repos/fnproject/cli/pulls/261/comments","review_comment_url":"https://api.github.com/repos/fnproject/cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fnproject/cli/issues/261/comments","statuses_url":"https://api.github.com/repos/fnproject/cli/statuses/abf97f94c60fff9d7c594bd14fedf4fb41f9f160","head":{"label":"JadeRedworth:update-command","ref":"update-command","sha":"abf97f94c60fff9d7c594bd14fedf4fb41f9f160","user":{"login":"JadeRedworth","id":25709275,"avatar_url":"https://avatars2.githubusercontent.com/u/25709275?v=4","gravatar_id":"","url":"https://api.github.com/users/JadeRedworth","html_url":"https://github.com/JadeRedworth","followers_url":"https://api.github.com/users/JadeRedworth/followers","following_url":"https://api.github.com/users/JadeRedworth/following{/other_user}","gists_url":"https://api.github.com/users/JadeRedworth/gists{/gist_id}","starred_url":"https://api.github.com/users/JadeRedworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JadeRedworth/subscriptions","organizations_url":"https://api.github.com/users/JadeRedworth/orgs","repos_url":"https://api.github.com/users/JadeRedworth/repos","events_url":"https://api.github.com/users/JadeRedworth/events{/privacy}","received_events_url":"https://api.github.com/users/JadeRedworth/received_events","type":"User","site_admin":false},"repo":{"id":128381384,"name":"cli","full_name":"JadeRedworth/cli","owner":{"login":"JadeRedworth","id":25709275,"avatar_url":"https://avatars2.githubusercontent.com/u/25709275?v=4","gravatar_id":"","url":"https://api.github.com/users/JadeRedworth","html_url":"https://github.com/JadeRedworth","followers_url":"https://api.github.com/users/JadeRedworth/followers","following_url":"https://api.github.com/users/JadeRedworth/following{/other_user}","gists_url":"https://api.github.com/users/JadeRedworth/gists{/gist_id}","starred_url":"https://api.github.com/users/JadeRedworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JadeRedworth/subscriptions","organizations_url":"https://api.github.com/users/JadeRedworth/orgs","repos_url":"https://api.github.com/users/JadeRedworth/repos","events_url":"https://api.github.com/users/JadeRedworth/events{/privacy}","received_events_url":"https://api.github.com/users/JadeRedworth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JadeRedworth/cli","description":"CLI tool for fnproject. ","fork":true,"url":"https://api.github.com/repos/JadeRedworth/cli","forks_url":"https://api.github.com/repos/JadeRedworth/cli/forks","keys_url":"https://api.github.com/repos/JadeRedworth/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JadeRedworth/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JadeRedworth/cli/teams","hooks_url":"https://api.github.com/repos/JadeRedworth/cli/hooks","issue_events_url":"https://api.github.com/repos/JadeRedworth/cli/issues/events{/number}","events_url":"https://api.github.com/repos/JadeRedworth/cli/events","assignees_url":"https://api.github.com/repos/JadeRedworth/cli/assignees{/user}","branches_url":"https://api.github.com/repos/JadeRedworth/cli/branches{/branch}","tags_url":"https://api.github.com/repos/JadeRedworth/cli/tags","blobs_url":"https://api.github.com/repos/JadeRedworth/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JadeRedworth/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JadeRedworth/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/JadeRedworth/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JadeRedworth/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/JadeRedworth/cli/languages","stargazers_url":"https://api.github.com/repos/JadeRedworth/cli/stargazers","contributors_url":"https://api.github.com/repos/JadeRedworth/cli/contributors","subscribers_url":"https://api.github.com/repos/JadeRedworth/cli/subscribers","subscription_url":"https://api.github.com/repos/JadeRedworth/cli/subscription","commits_url":"https://api.github.com/repos/JadeRedworth/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/JadeRedworth/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/JadeRedworth/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/JadeRedworth/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/JadeRedworth/cli/contents/{+path}","compare_url":"https://api.github.com/repos/JadeRedworth/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JadeRedworth/cli/merges","archive_url":"https://api.github.com/repos/JadeRedworth/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JadeRedworth/cli/downloads","issues_url":"https://api.github.com/repos/JadeRedworth/cli/issues{/number}","pulls_url":"https://api.github.com/repos/JadeRedworth/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/JadeRedworth/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/JadeRedworth/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JadeRedworth/cli/labels{/name}","releases_url":"https://api.github.com/repos/JadeRedworth/cli/releases{/id}","deployments_url":"https://api.github.com/repos/JadeRedworth/cli/deployments","created_at":"2018-04-06T10:33:59Z","updated_at":"2018-05-02T17:09:01Z","pushed_at":"2018-05-02T22:31:34Z","git_url":"git://github.com/JadeRedworth/cli.git","ssh_url":"git@github.com:JadeRedworth/cli.git","clone_url":"https://github.com/JadeRedworth/cli.git","svn_url":"https://github.com/JadeRedworth/cli","homepage":"https://fnproject.io","size":380,"stargazers_count":0,"watchers_count":0,"language":"Go","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":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fnproject:master","ref":"master","sha":"757454e18abcb2eb5747531a291678a88bed88bd","user":{"login":"fnproject","id":30273834,"avatar_url":"https://avatars2.githubusercontent.com/u/30273834?v=4","gravatar_id":"","url":"https://api.github.com/users/fnproject","html_url":"https://github.com/fnproject","followers_url":"https://api.github.com/users/fnproject/followers","following_url":"https://api.github.com/users/fnproject/following{/other_user}","gists_url":"https://api.github.com/users/fnproject/gists{/gist_id}","starred_url":"https://api.github.com/users/fnproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnproject/subscriptions","organizations_url":"https://api.github.com/users/fnproject/orgs","repos_url":"https://api.github.com/users/fnproject/repos","events_url":"https://api.github.com/users/fnproject/events{/privacy}","received_events_url":"https://api.github.com/users/fnproject/received_events","type":"Organization","site_admin":false},"repo":{"id":98561430,"name":"cli","full_name":"fnproject/cli","owner":{"login":"fnproject","id":30273834,"avatar_url":"https://avatars2.githubusercontent.com/u/30273834?v=4","gravatar_id":"","url":"https://api.github.com/users/fnproject","html_url":"https://github.com/fnproject","followers_url":"https://api.github.com/users/fnproject/followers","following_url":"https://api.github.com/users/fnproject/following{/other_user}","gists_url":"https://api.github.com/users/fnproject/gists{/gist_id}","starred_url":"https://api.github.com/users/fnproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnproject/subscriptions","organizations_url":"https://api.github.com/users/fnproject/orgs","repos_url":"https://api.github.com/users/fnproject/repos","events_url":"https://api.github.com/users/fnproject/events{/privacy}","received_events_url":"https://api.github.com/users/fnproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fnproject/cli","description":"CLI tool for fnproject. ","fork":false,"url":"https://api.github.com/repos/fnproject/cli","forks_url":"https://api.github.com/repos/fnproject/cli/forks","keys_url":"https://api.github.com/repos/fnproject/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fnproject/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fnproject/cli/teams","hooks_url":"https://api.github.com/repos/fnproject/cli/hooks","issue_events_url":"https://api.github.com/repos/fnproject/cli/issues/events{/number}","events_url":"https://api.github.com/repos/fnproject/cli/events","assignees_url":"https://api.github.com/repos/fnproject/cli/assignees{/user}","branches_url":"https://api.github.com/repos/fnproject/cli/branches{/branch}","tags_url":"https://api.github.com/repos/fnproject/cli/tags","blobs_url":"https://api.github.com/repos/fnproject/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fnproject/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fnproject/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/fnproject/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fnproject/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/fnproject/cli/languages","stargazers_url":"https://api.github.com/repos/fnproject/cli/stargazers","contributors_url":"https://api.github.com/repos/fnproject/cli/contributors","subscribers_url":"https://api.github.com/repos/fnproject/cli/subscribers","subscription_url":"https://api.github.com/repos/fnproject/cli/subscription","commits_url":"https://api.github.com/repos/fnproject/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/fnproject/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/fnproject/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/fnproject/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/fnproject/cli/contents/{+path}","compare_url":"https://api.github.com/repos/fnproject/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fnproject/cli/merges","archive_url":"https://api.github.com/repos/fnproject/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fnproject/cli/downloads","issues_url":"https://api.github.com/repos/fnproject/cli/issues{/number}","pulls_url":"https://api.github.com/repos/fnproject/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/fnproject/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/fnproject/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fnproject/cli/labels{/name}","releases_url":"https://api.github.com/repos/fnproject/cli/releases{/id}","deployments_url":"https://api.github.com/repos/fnproject/cli/deployments","created_at":"2017-07-27T17:01:37Z","updated_at":"2018-05-02T12:10:45Z","pushed_at":"2018-05-02T22:31:35Z","git_url":"git://github.com/fnproject/cli.git","ssh_url":"git@github.com:fnproject/cli.git","clone_url":"https://github.com/fnproject/cli.git","svn_url":"https://github.com/fnproject/cli","homepage":"https://fnproject.io","size":371,"stargazers_count":55,"watchers_count":55,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"archived":false,"open_issues_count":70,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":24,"open_issues":70,"watchers":55,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fnproject/cli/pulls/261"},"html":{"href":"https://github.com/fnproject/cli/pull/261"},"issue":{"href":"https://api.github.com/repos/fnproject/cli/issues/261"},"comments":{"href":"https://api.github.com/repos/fnproject/cli/issues/261/comments"},"review_comments":{"href":"https://api.github.com/repos/fnproject/cli/pulls/261/comments"},"review_comment":{"href":"https://api.github.com/repos/fnproject/cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fnproject/cli/pulls/261/commits"},"statuses":{"href":"https://api.github.com/repos/fnproject/cli/statuses/abf97f94c60fff9d7c594bd14fedf4fb41f9f160"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"denismakogon"}}