{"action":"created","comment":{"url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/pulls/comments/39808209","id":39808209,"diff_hunk":"@@ -1,10 +1,14 @@\n function omf.destroy -d \"Remove Oh My Fish\"\n   echo (omf::dim)\"Removing Oh My Fish...\"(omf::off)\n \n-  omf.remove_package (basename $OMF_PATH/pkg/*) >/dev/null ^&1\n+  for pkg in (basename $OMF_PATH/pkg/*)\n+    omf.remove_package $pkg >/dev/null ^&1\n+  end\n \n-  if test -e \"$HOME/.config/fish/config.copy\"\n-    mv \"$HOME/.config/fish/config\".{copy,fish}\n+  set -l localbackup (find $HOME/.config/fish/ -regextype posix-extended -regex '^.*fish/config\\.[[:digit:]]+\\.copy$' |\\\n+    sort -r |head -1)\n+  if test -n $localbackup\n+    mv $localbackup \"$HOME/.config/fish/config.fish\"","path":"pkg/omf/cli/omf.destroy.fish","position":14,"original_position":14,"commit_id":"8707800f8abfc09f293ad20f989ccfa385746ce5","original_commit_id":"8707800f8abfc09f293ad20f989ccfa385746ce5","user":{"login":"derekstavis","id":1611639,"avatar_url":"https://avatars.githubusercontent.com/u/1611639?v=3","gravatar_id":"","url":"https://api.github.com/users/derekstavis","html_url":"https://github.com/derekstavis","followers_url":"https://api.github.com/users/derekstavis/followers","following_url":"https://api.github.com/users/derekstavis/following{/other_user}","gists_url":"https://api.github.com/users/derekstavis/gists{/gist_id}","starred_url":"https://api.github.com/users/derekstavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekstavis/subscriptions","organizations_url":"https://api.github.com/users/derekstavis/orgs","repos_url":"https://api.github.com/users/derekstavis/repos","events_url":"https://api.github.com/users/derekstavis/events{/privacy}","received_events_url":"https://api.github.com/users/derekstavis/received_events","type":"User","site_admin":false},"body":"You could use XDG specification (`$XDG_CONFIG_HOME`). Using a variable to store it and fallback to `~/.config` when empty would be greater.","created_at":"2015-09-17T22:46:47Z","updated_at":"2015-09-17T22:46:47Z","html_url":"https://github.com/oh-my-fish/oh-my-fish/pull/48#discussion_r39808209","pull_request_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/pulls/48","_links":{"self":{"href":"https://api.github.com/repos/oh-my-fish/oh-my-fish/pulls/comments/39808209"},"html":{"href":"https://github.com/oh-my-fish/oh-my-fish/pull/48#discussion_r39808209"},"pull_request":{"href":"https://api.github.com/repos/oh-my-fish/oh-my-fish/pulls/48"}}},"pull_request":{"url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/pulls/48","id":44862367,"html_url":"https://github.com/oh-my-fish/oh-my-fish/pull/48","diff_url":"https://github.com/oh-my-fish/oh-my-fish/pull/48.diff","patch_url":"https://github.com/oh-my-fish/oh-my-fish/pull/48.patch","issue_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/issues/48","number":48,"state":"open","locked":false,"title":"Fixing how omf remove work, and omf.remove_package","user":{"login":"jeremiejig","id":3978761,"avatar_url":"https://avatars.githubusercontent.com/u/3978761?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremiejig","html_url":"https://github.com/jeremiejig","followers_url":"https://api.github.com/users/jeremiejig/followers","following_url":"https://api.github.com/users/jeremiejig/following{/other_user}","gists_url":"https://api.github.com/users/jeremiejig/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremiejig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremiejig/subscriptions","organizations_url":"https://api.github.com/users/jeremiejig/orgs","repos_url":"https://api.github.com/users/jeremiejig/repos","events_url":"https://api.github.com/users/jeremiejig/events{/privacy}","received_events_url":"https://api.github.com/users/jeremiejig/received_events","type":"User","site_admin":false},"body":"**omf.destroy** was broken because of a [premature refresh].\r\nAnd with [this code] it was giving the impression that omf was hanging while in fact fish was running without a display.\r\n\r\nWhen fixing the bug I assumed that remove_package do the minimal (handle only one pkg)\r\nAt the time of the PR the indent in [omf.remove_package.fish] might be broken.\r\n\r\nI am now working on [omf.destroy.fish] to find the most recent backup of config.fish (for this PR)\r\n\r\n\r\n[premature refresh]: https://github.com/oh-my-fish/oh-my-fish/blob/4b0dbc270b9ab73d56aa0d07d820243d22479892/pkg/omf/cli/omf.remove_package.fish#L40\r\n[this code]: https://github.com/oh-my-fish/oh-my-fish/blob/4b0dbc270b9ab73d56aa0d07d820243d22479892/pkg/omf/cli/omf.destroy.fish#L4\r\n[omf.remove_package.fish]: https://github.com/jeremiejig/oh-my-fish/blob/d40328974835112fdcb2a6309c44c57b035a88c9/pkg/omf/cli/omf.remove_package.fish\r\n[omf.destroy.fish]: https://github.com/jeremiejig/oh-my-fish/blob/d40328974835112fdcb2a6309c44c57b035a88c9/pkg/omf/cli/omf.destroy.fish#L8","created_at":"2015-09-12T22:14:04Z","updated_at":"2015-09-17T22:46:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"764becd0f58d51d3fc7664c9e8b6fc6e672add59","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/pulls/48/commits","review_comments_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/pulls/48/comments","review_comment_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/issues/48/comments","statuses_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/statuses/8707800f8abfc09f293ad20f989ccfa385746ce5","head":{"label":"jeremiejig:fixomfdestroy","ref":"fixomfdestroy","sha":"8707800f8abfc09f293ad20f989ccfa385746ce5","user":{"login":"jeremiejig","id":3978761,"avatar_url":"https://avatars.githubusercontent.com/u/3978761?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremiejig","html_url":"https://github.com/jeremiejig","followers_url":"https://api.github.com/users/jeremiejig/followers","following_url":"https://api.github.com/users/jeremiejig/following{/other_user}","gists_url":"https://api.github.com/users/jeremiejig/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremiejig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremiejig/subscriptions","organizations_url":"https://api.github.com/users/jeremiejig/orgs","repos_url":"https://api.github.com/users/jeremiejig/repos","events_url":"https://api.github.com/users/jeremiejig/events{/privacy}","received_events_url":"https://api.github.com/users/jeremiejig/received_events","type":"User","site_admin":false},"repo":{"id":42306399,"name":"oh-my-fish","full_name":"jeremiejig/oh-my-fish","owner":{"login":"jeremiejig","id":3978761,"avatar_url":"https://avatars.githubusercontent.com/u/3978761?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremiejig","html_url":"https://github.com/jeremiejig","followers_url":"https://api.github.com/users/jeremiejig/followers","following_url":"https://api.github.com/users/jeremiejig/following{/other_user}","gists_url":"https://api.github.com/users/jeremiejig/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremiejig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremiejig/subscriptions","organizations_url":"https://api.github.com/users/jeremiejig/orgs","repos_url":"https://api.github.com/users/jeremiejig/repos","events_url":"https://api.github.com/users/jeremiejig/events{/privacy}","received_events_url":"https://api.github.com/users/jeremiejig/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jeremiejig/oh-my-fish","description":"The Fishshell Framework.","fork":true,"url":"https://api.github.com/repos/jeremiejig/oh-my-fish","forks_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/forks","keys_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/teams","hooks_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/hooks","issue_events_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/issues/events{/number}","events_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/events","assignees_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/assignees{/user}","branches_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/branches{/branch}","tags_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/tags","blobs_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/git/refs{/sha}","trees_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/statuses/{sha}","languages_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/languages","stargazers_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/stargazers","contributors_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/contributors","subscribers_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/subscribers","subscription_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/subscription","commits_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/commits{/sha}","git_commits_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/git/commits{/sha}","comments_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/comments{/number}","issue_comment_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/issues/comments{/number}","contents_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/contents/{+path}","compare_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/merges","archive_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/downloads","issues_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/issues{/number}","pulls_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/pulls{/number}","milestones_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/milestones{/number}","notifications_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/labels{/name}","releases_url":"https://api.github.com/repos/jeremiejig/oh-my-fish/releases{/id}","created_at":"2015-09-11T12:10:47Z","updated_at":"2015-09-11T12:10:47Z","pushed_at":"2015-09-17T20:42:03Z","git_url":"git://github.com/jeremiejig/oh-my-fish.git","ssh_url":"git@github.com:jeremiejig/oh-my-fish.git","clone_url":"https://github.com/jeremiejig/oh-my-fish.git","svn_url":"https://github.com/jeremiejig/oh-my-fish","homepage":"","size":2355,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"jeremiejig"}},"base":{"label":"oh-my-fish:master","ref":"master","sha":"e69bc8b19525d81d34489caa39ae101dcef63c2c","user":{"login":"oh-my-fish","id":11728505,"avatar_url":"https://avatars.githubusercontent.com/u/11728505?v=3","gravatar_id":"","url":"https://api.github.com/users/oh-my-fish","html_url":"https://github.com/oh-my-fish","followers_url":"https://api.github.com/users/oh-my-fish/followers","following_url":"https://api.github.com/users/oh-my-fish/following{/other_user}","gists_url":"https://api.github.com/users/oh-my-fish/gists{/gist_id}","starred_url":"https://api.github.com/users/oh-my-fish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oh-my-fish/subscriptions","organizations_url":"https://api.github.com/users/oh-my-fish/orgs","repos_url":"https://api.github.com/users/oh-my-fish/repos","events_url":"https://api.github.com/users/oh-my-fish/events{/privacy}","received_events_url":"https://api.github.com/users/oh-my-fish/received_events","type":"Organization","site_admin":false},"repo":{"id":41871628,"name":"oh-my-fish","full_name":"oh-my-fish/oh-my-fish","owner":{"login":"oh-my-fish","id":11728505,"avatar_url":"https://avatars.githubusercontent.com/u/11728505?v=3","gravatar_id":"","url":"https://api.github.com/users/oh-my-fish","html_url":"https://github.com/oh-my-fish","followers_url":"https://api.github.com/users/oh-my-fish/followers","following_url":"https://api.github.com/users/oh-my-fish/following{/other_user}","gists_url":"https://api.github.com/users/oh-my-fish/gists{/gist_id}","starred_url":"https://api.github.com/users/oh-my-fish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oh-my-fish/subscriptions","organizations_url":"https://api.github.com/users/oh-my-fish/orgs","repos_url":"https://api.github.com/users/oh-my-fish/repos","events_url":"https://api.github.com/users/oh-my-fish/events{/privacy}","received_events_url":"https://api.github.com/users/oh-my-fish/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oh-my-fish/oh-my-fish","description":"The Fishshell Framework.","fork":false,"url":"https://api.github.com/repos/oh-my-fish/oh-my-fish","forks_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/forks","keys_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/teams","hooks_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/hooks","issue_events_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/issues/events{/number}","events_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/events","assignees_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/assignees{/user}","branches_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/branches{/branch}","tags_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/tags","blobs_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/git/refs{/sha}","trees_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/statuses/{sha}","languages_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/languages","stargazers_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/stargazers","contributors_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/contributors","subscribers_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/subscribers","subscription_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/subscription","commits_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/commits{/sha}","git_commits_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/git/commits{/sha}","comments_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/comments{/number}","issue_comment_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/issues/comments{/number}","contents_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/contents/{+path}","compare_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/merges","archive_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/downloads","issues_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/issues{/number}","pulls_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/pulls{/number}","milestones_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/milestones{/number}","notifications_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/labels{/name}","releases_url":"https://api.github.com/repos/oh-my-fish/oh-my-fish/releases{/id}","created_at":"2015-09-03T16:47:31Z","updated_at":"2015-09-17T19:18:56Z","pushed_at":"2015-09-17T20:42:03Z","git_url":"git://github.com/oh-my-fish/oh-my-fish.git","ssh_url":"git@github.com:oh-my-fish/oh-my-fish.git","clone_url":"https://github.com/oh-my-fish/oh-my-fish.git","svn_url":"https://github.com/oh-my-fish/oh-my-fish","homepage":"","size":2939,"stargazers_count":86,"watchers_count":86,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":18,"forks":11,"open_issues":18,"watchers":86,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/oh-my-fish/oh-my-fish/pulls/48"},"html":{"href":"https://github.com/oh-my-fish/oh-my-fish/pull/48"},"issue":{"href":"https://api.github.com/repos/oh-my-fish/oh-my-fish/issues/48"},"comments":{"href":"https://api.github.com/repos/oh-my-fish/oh-my-fish/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/oh-my-fish/oh-my-fish/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/oh-my-fish/oh-my-fish/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oh-my-fish/oh-my-fish/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/oh-my-fish/oh-my-fish/statuses/8707800f8abfc09f293ad20f989ccfa385746ce5"}}}}