{"action":"created","comment":{"url":"https://api.github.com/repos/hasufell/ghcup/pulls/comments/225099077","pull_request_review_id":164623098,"id":225099077,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTA5OTA3Nw==","diff_hunk":"@@ -994,7 +994,7 @@ while [ $# -gt 0 ] ; do\n            if [ \"${TARGET_LOCATION}\" ] ; then\n                self_update \"${TARGET_LOCATION}\"\n            else\n-               self_update \"${HOME}/.local/bin\"\n+               self_update \"$(dirname $0)\"","path":"ghcup","position":5,"original_position":5,"commit_id":"8f13f47f0b5cd31a5fbd55fd6a9f4b66e4827355","original_commit_id":"8f13f47f0b5cd31a5fbd55fd6a9f4b66e4827355","user":{"login":"hasufell","id":1241845,"node_id":"MDQ6VXNlcjEyNDE4NDU=","avatar_url":"https://avatars1.githubusercontent.com/u/1241845?v=4","gravatar_id":"","url":"https://api.github.com/users/hasufell","html_url":"https://github.com/hasufell","followers_url":"https://api.github.com/users/hasufell/followers","following_url":"https://api.github.com/users/hasufell/following{/other_user}","gists_url":"https://api.github.com/users/hasufell/gists{/gist_id}","starred_url":"https://api.github.com/users/hasufell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasufell/subscriptions","organizations_url":"https://api.github.com/users/hasufell/orgs","repos_url":"https://api.github.com/users/hasufell/repos","events_url":"https://api.github.com/users/hasufell/events{/privacy}","received_events_url":"https://api.github.com/users/hasufell/received_events","type":"User","site_admin":false},"body":"1. this isn't really safe, see https://stackoverflow.com/a/49964642/2976251 and https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within and https://stackoverflow.com/questions/9889938/shell-script-current-directory\r\n2. doesn't pass shellcheck","created_at":"2018-10-15T09:38:33Z","updated_at":"2018-10-15T09:38:34Z","html_url":"https://github.com/hasufell/ghcup/pull/12#discussion_r225099077","pull_request_url":"https://api.github.com/repos/hasufell/ghcup/pulls/12","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/hasufell/ghcup/pulls/comments/225099077"},"html":{"href":"https://github.com/hasufell/ghcup/pull/12#discussion_r225099077"},"pull_request":{"href":"https://api.github.com/repos/hasufell/ghcup/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/hasufell/ghcup/pulls/12","id":222831990,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyODMxOTkw","html_url":"https://github.com/hasufell/ghcup/pull/12","diff_url":"https://github.com/hasufell/ghcup/pull/12.diff","patch_url":"https://github.com/hasufell/ghcup/pull/12.patch","issue_url":"https://api.github.com/repos/hasufell/ghcup/issues/12","number":12,"state":"open","locked":false,"title":"self-update in-place","user":{"login":"fommil","id":1914041,"node_id":"MDQ6VXNlcjE5MTQwNDE=","avatar_url":"https://avatars2.githubusercontent.com/u/1914041?v=4","gravatar_id":"","url":"https://api.github.com/users/fommil","html_url":"https://github.com/fommil","followers_url":"https://api.github.com/users/fommil/followers","following_url":"https://api.github.com/users/fommil/following{/other_user}","gists_url":"https://api.github.com/users/fommil/gists{/gist_id}","starred_url":"https://api.github.com/users/fommil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fommil/subscriptions","organizations_url":"https://api.github.com/users/fommil/orgs","repos_url":"https://api.github.com/users/fommil/repos","events_url":"https://api.github.com/users/fommil/events{/privacy}","received_events_url":"https://api.github.com/users/fommil/received_events","type":"User","site_admin":false},"body":"Doesn't assume an installation directory.","created_at":"2018-10-15T09:07:31Z","updated_at":"2018-10-15T09:38:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"30616c208d4c4eb13b306406608da41846bd13b2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hasufell/ghcup/pulls/12/commits","review_comments_url":"https://api.github.com/repos/hasufell/ghcup/pulls/12/comments","review_comment_url":"https://api.github.com/repos/hasufell/ghcup/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hasufell/ghcup/issues/12/comments","statuses_url":"https://api.github.com/repos/hasufell/ghcup/statuses/8f13f47f0b5cd31a5fbd55fd6a9f4b66e4827355","head":{"label":"fommil:self-update-in-place","ref":"self-update-in-place","sha":"8f13f47f0b5cd31a5fbd55fd6a9f4b66e4827355","user":{"login":"fommil","id":1914041,"node_id":"MDQ6VXNlcjE5MTQwNDE=","avatar_url":"https://avatars2.githubusercontent.com/u/1914041?v=4","gravatar_id":"","url":"https://api.github.com/users/fommil","html_url":"https://github.com/fommil","followers_url":"https://api.github.com/users/fommil/followers","following_url":"https://api.github.com/users/fommil/following{/other_user}","gists_url":"https://api.github.com/users/fommil/gists{/gist_id}","starred_url":"https://api.github.com/users/fommil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fommil/subscriptions","organizations_url":"https://api.github.com/users/fommil/orgs","repos_url":"https://api.github.com/users/fommil/repos","events_url":"https://api.github.com/users/fommil/events{/privacy}","received_events_url":"https://api.github.com/users/fommil/received_events","type":"User","site_admin":false},"repo":{"id":153083444,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMwODM0NDQ=","name":"ghcup","full_name":"fommil/ghcup","private":false,"owner":{"login":"fommil","id":1914041,"node_id":"MDQ6VXNlcjE5MTQwNDE=","avatar_url":"https://avatars2.githubusercontent.com/u/1914041?v=4","gravatar_id":"","url":"https://api.github.com/users/fommil","html_url":"https://github.com/fommil","followers_url":"https://api.github.com/users/fommil/followers","following_url":"https://api.github.com/users/fommil/following{/other_user}","gists_url":"https://api.github.com/users/fommil/gists{/gist_id}","starred_url":"https://api.github.com/users/fommil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fommil/subscriptions","organizations_url":"https://api.github.com/users/fommil/orgs","repos_url":"https://api.github.com/users/fommil/repos","events_url":"https://api.github.com/users/fommil/events{/privacy}","received_events_url":"https://api.github.com/users/fommil/received_events","type":"User","site_admin":false},"html_url":"https://github.com/fommil/ghcup","description":"Painless installation of GHC toolchain (without stack)","fork":true,"url":"https://api.github.com/repos/fommil/ghcup","forks_url":"https://api.github.com/repos/fommil/ghcup/forks","keys_url":"https://api.github.com/repos/fommil/ghcup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fommil/ghcup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fommil/ghcup/teams","hooks_url":"https://api.github.com/repos/fommil/ghcup/hooks","issue_events_url":"https://api.github.com/repos/fommil/ghcup/issues/events{/number}","events_url":"https://api.github.com/repos/fommil/ghcup/events","assignees_url":"https://api.github.com/repos/fommil/ghcup/assignees{/user}","branches_url":"https://api.github.com/repos/fommil/ghcup/branches{/branch}","tags_url":"https://api.github.com/repos/fommil/ghcup/tags","blobs_url":"https://api.github.com/repos/fommil/ghcup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fommil/ghcup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fommil/ghcup/git/refs{/sha}","trees_url":"https://api.github.com/repos/fommil/ghcup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fommil/ghcup/statuses/{sha}","languages_url":"https://api.github.com/repos/fommil/ghcup/languages","stargazers_url":"https://api.github.com/repos/fommil/ghcup/stargazers","contributors_url":"https://api.github.com/repos/fommil/ghcup/contributors","subscribers_url":"https://api.github.com/repos/fommil/ghcup/subscribers","subscription_url":"https://api.github.com/repos/fommil/ghcup/subscription","commits_url":"https://api.github.com/repos/fommil/ghcup/commits{/sha}","git_commits_url":"https://api.github.com/repos/fommil/ghcup/git/commits{/sha}","comments_url":"https://api.github.com/repos/fommil/ghcup/comments{/number}","issue_comment_url":"https://api.github.com/repos/fommil/ghcup/issues/comments{/number}","contents_url":"https://api.github.com/repos/fommil/ghcup/contents/{+path}","compare_url":"https://api.github.com/repos/fommil/ghcup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fommil/ghcup/merges","archive_url":"https://api.github.com/repos/fommil/ghcup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fommil/ghcup/downloads","issues_url":"https://api.github.com/repos/fommil/ghcup/issues{/number}","pulls_url":"https://api.github.com/repos/fommil/ghcup/pulls{/number}","milestones_url":"https://api.github.com/repos/fommil/ghcup/milestones{/number}","notifications_url":"https://api.github.com/repos/fommil/ghcup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fommil/ghcup/labels{/name}","releases_url":"https://api.github.com/repos/fommil/ghcup/releases{/id}","deployments_url":"https://api.github.com/repos/fommil/ghcup/deployments","created_at":"2018-10-15T09:03:31Z","updated_at":"2018-10-15T09:03:33Z","pushed_at":"2018-10-15T09:13:22Z","git_url":"git://github.com/fommil/ghcup.git","ssh_url":"git@github.com:fommil/ghcup.git","clone_url":"https://github.com/fommil/ghcup.git","svn_url":"https://github.com/fommil/ghcup","homepage":"","size":129,"stargazers_count":0,"watchers_count":0,"language":"Shell","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":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hasufell:master","ref":"master","sha":"e2f85dc17e46eaffe310a92416263dba3608681a","user":{"login":"hasufell","id":1241845,"node_id":"MDQ6VXNlcjEyNDE4NDU=","avatar_url":"https://avatars1.githubusercontent.com/u/1241845?v=4","gravatar_id":"","url":"https://api.github.com/users/hasufell","html_url":"https://github.com/hasufell","followers_url":"https://api.github.com/users/hasufell/followers","following_url":"https://api.github.com/users/hasufell/following{/other_user}","gists_url":"https://api.github.com/users/hasufell/gists{/gist_id}","starred_url":"https://api.github.com/users/hasufell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasufell/subscriptions","organizations_url":"https://api.github.com/users/hasufell/orgs","repos_url":"https://api.github.com/users/hasufell/repos","events_url":"https://api.github.com/users/hasufell/events{/privacy}","received_events_url":"https://api.github.com/users/hasufell/received_events","type":"User","site_admin":false},"repo":{"id":150830607,"node_id":"MDEwOlJlcG9zaXRvcnkxNTA4MzA2MDc=","name":"ghcup","full_name":"hasufell/ghcup","private":false,"owner":{"login":"hasufell","id":1241845,"node_id":"MDQ6VXNlcjEyNDE4NDU=","avatar_url":"https://avatars1.githubusercontent.com/u/1241845?v=4","gravatar_id":"","url":"https://api.github.com/users/hasufell","html_url":"https://github.com/hasufell","followers_url":"https://api.github.com/users/hasufell/followers","following_url":"https://api.github.com/users/hasufell/following{/other_user}","gists_url":"https://api.github.com/users/hasufell/gists{/gist_id}","starred_url":"https://api.github.com/users/hasufell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasufell/subscriptions","organizations_url":"https://api.github.com/users/hasufell/orgs","repos_url":"https://api.github.com/users/hasufell/repos","events_url":"https://api.github.com/users/hasufell/events{/privacy}","received_events_url":"https://api.github.com/users/hasufell/received_events","type":"User","site_admin":false},"html_url":"https://github.com/hasufell/ghcup","description":"Painless installation of GHC toolchain (without stack)","fork":false,"url":"https://api.github.com/repos/hasufell/ghcup","forks_url":"https://api.github.com/repos/hasufell/ghcup/forks","keys_url":"https://api.github.com/repos/hasufell/ghcup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hasufell/ghcup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hasufell/ghcup/teams","hooks_url":"https://api.github.com/repos/hasufell/ghcup/hooks","issue_events_url":"https://api.github.com/repos/hasufell/ghcup/issues/events{/number}","events_url":"https://api.github.com/repos/hasufell/ghcup/events","assignees_url":"https://api.github.com/repos/hasufell/ghcup/assignees{/user}","branches_url":"https://api.github.com/repos/hasufell/ghcup/branches{/branch}","tags_url":"https://api.github.com/repos/hasufell/ghcup/tags","blobs_url":"https://api.github.com/repos/hasufell/ghcup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hasufell/ghcup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hasufell/ghcup/git/refs{/sha}","trees_url":"https://api.github.com/repos/hasufell/ghcup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hasufell/ghcup/statuses/{sha}","languages_url":"https://api.github.com/repos/hasufell/ghcup/languages","stargazers_url":"https://api.github.com/repos/hasufell/ghcup/stargazers","contributors_url":"https://api.github.com/repos/hasufell/ghcup/contributors","subscribers_url":"https://api.github.com/repos/hasufell/ghcup/subscribers","subscription_url":"https://api.github.com/repos/hasufell/ghcup/subscription","commits_url":"https://api.github.com/repos/hasufell/ghcup/commits{/sha}","git_commits_url":"https://api.github.com/repos/hasufell/ghcup/git/commits{/sha}","comments_url":"https://api.github.com/repos/hasufell/ghcup/comments{/number}","issue_comment_url":"https://api.github.com/repos/hasufell/ghcup/issues/comments{/number}","contents_url":"https://api.github.com/repos/hasufell/ghcup/contents/{+path}","compare_url":"https://api.github.com/repos/hasufell/ghcup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hasufell/ghcup/merges","archive_url":"https://api.github.com/repos/hasufell/ghcup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hasufell/ghcup/downloads","issues_url":"https://api.github.com/repos/hasufell/ghcup/issues{/number}","pulls_url":"https://api.github.com/repos/hasufell/ghcup/pulls{/number}","milestones_url":"https://api.github.com/repos/hasufell/ghcup/milestones{/number}","notifications_url":"https://api.github.com/repos/hasufell/ghcup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hasufell/ghcup/labels{/name}","releases_url":"https://api.github.com/repos/hasufell/ghcup/releases{/id}","deployments_url":"https://api.github.com/repos/hasufell/ghcup/deployments","created_at":"2018-09-29T06:04:06Z","updated_at":"2018-10-15T09:07:29Z","pushed_at":"2018-10-15T09:13:24Z","git_url":"git://github.com/hasufell/ghcup.git","ssh_url":"git@github.com:hasufell/ghcup.git","clone_url":"https://github.com/hasufell/ghcup.git","svn_url":"https://github.com/hasufell/ghcup","homepage":"","size":129,"stargazers_count":22,"watchers_count":22,"language":"Shell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":3,"open_issues":9,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hasufell/ghcup/pulls/12"},"html":{"href":"https://github.com/hasufell/ghcup/pull/12"},"issue":{"href":"https://api.github.com/repos/hasufell/ghcup/issues/12"},"comments":{"href":"https://api.github.com/repos/hasufell/ghcup/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/hasufell/ghcup/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/hasufell/ghcup/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hasufell/ghcup/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/hasufell/ghcup/statuses/8f13f47f0b5cd31a5fbd55fd6a9f4b66e4827355"}},"author_association":"NONE"}}
{"actor":{"display_login":"hasufell"}}