{"action":"created","comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/26437179","id":26437179,"diff_hunk":"@@ -0,0 +1,93 @@\n+# Original Inspiration: Stephen Benner https://github.com/SteveBenner: https://gist.github.com/SteveBenner/11254428\n+# Partially Rewritten by Dominyk Tiller https://github.com/DomT4 for Homebrew's internal use.\n+# THIS WILL COMPLETELY REMOVE HOMEBREW FROM YOUR SYSTEM\n+\n+require \"fileutils\"\n+require \"open3\"\n+require \"rubygems\"\n+\n+begin\n+  require \"trollop\"\n+rescue LoadError\n+  onoe \"You must run `sudo /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/gem install trollop`\"\n+  raise\n+end\n+\n+module Homebrew\n+  def __selfdestruct\n+\n+@options = Trollop::options do\n+  opt :quiet, \"Run script with minimal user-visible output\"\n+  opt :verbose, \"Run script with maximum user-visible output\"\n+  opt :dryrun, \"Don't delete anything. Just show what would happen\"\n+end\n+\n+brew_location = HOMEBREW_PREFIX\n+\n+brewlocal = %W{.git Cellar Library/brew.rb Library/Homebrew Library/Aliases Library/Formula Library/Contributions Library/ENV Library/LinkedKegs}\n+$files = []\n+\n+# Found Homebrew installation\n+if brew_location\n+  unless @options[:quiet]\n+    puts \"Homebrew found at: #{brew_location}\"\n+    begin # record kegs and taps for later output\n+      brewed = `brew list`\n+      tapped = `brew tap`\n+    rescue StandardError\n+    end\n+  end\n+  # Collect files indexed by git\n+  begin\n+    Dir.chdir(brew_location) do\n+      # Update file list (use popen3 so we can suppress git error output)\n+      Open3.popen3('git checkout master') { |stdin, stdout, stderr| stderr.close }\n+      $files += `git ls-files`.split.map {|file| File.expand_path file }\n+    end\n+  rescue StandardError => e\n+    puts e\n+  end\n+end\n+\n+# Collect files\n+$files += brewlocal.select { |file| File.exist? file }.map {|file| File.expand_path file }\n+cache = \"#{HOMEBREW_CACHE}\"\n+logs = \"#{HOMEBREW_LOGS}\"\n+\n+abort 'Failed to locate any homebrew files!' if $files.empty?\n+\n+rm =\n+  if @options[:dryrun]","path":"Library/Homebrew/cmd/--selfdestruct.rb","position":60,"original_position":60,"commit_id":"6871015d52d2d6060c0189cc9884ffb7ad9b8289","original_commit_id":"6871015d52d2d6060c0189cc9884ffb7ad9b8289","user":{"login":"xu-cheng","id":3105373,"avatar_url":"https://avatars.githubusercontent.com/u/3105373?v=3","gravatar_id":"","url":"https://api.github.com/users/xu-cheng","html_url":"https://github.com/xu-cheng","followers_url":"https://api.github.com/users/xu-cheng/followers","following_url":"https://api.github.com/users/xu-cheng/following{/other_user}","gists_url":"https://api.github.com/users/xu-cheng/gists{/gist_id}","starred_url":"https://api.github.com/users/xu-cheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xu-cheng/subscriptions","organizations_url":"https://api.github.com/users/xu-cheng/orgs","repos_url":"https://api.github.com/users/xu-cheng/repos","events_url":"https://api.github.com/users/xu-cheng/events{/privacy}","received_events_url":"https://api.github.com/users/xu-cheng/received_events","type":"User","site_admin":false},"body":"I prefer an interactive version of uninstall script. Just like what we do in the install script.","created_at":"2015-03-14T11:19:53Z","updated_at":"2015-03-14T11:19:53Z","html_url":"https://github.com/Homebrew/homebrew/pull/37713#discussion_r26437179","pull_request_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/37713","_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/26437179"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/37713#discussion_r26437179"},"pull_request":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/37713"}}},"pull_request":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/37713","id":31181969,"html_url":"https://github.com/Homebrew/homebrew/pull/37713","diff_url":"https://github.com/Homebrew/homebrew/pull/37713.diff","patch_url":"https://github.com/Homebrew/homebrew/pull/37713.patch","issue_url":"https://api.github.com/repos/Homebrew/homebrew/issues/37713","number":37713,"state":"open","locked":false,"title":"homebrew: create selfdestruct cmd","user":{"login":"DomT4","id":6998367,"avatar_url":"https://avatars.githubusercontent.com/u/6998367?v=3","gravatar_id":"","url":"https://api.github.com/users/DomT4","html_url":"https://github.com/DomT4","followers_url":"https://api.github.com/users/DomT4/followers","following_url":"https://api.github.com/users/DomT4/following{/other_user}","gists_url":"https://api.github.com/users/DomT4/gists{/gist_id}","starred_url":"https://api.github.com/users/DomT4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DomT4/subscriptions","organizations_url":"https://api.github.com/users/DomT4/orgs","repos_url":"https://api.github.com/users/DomT4/repos","events_url":"https://api.github.com/users/DomT4/events{/privacy}","received_events_url":"https://api.github.com/users/DomT4/received_events","type":"User","site_admin":false},"body":"Previously: #31860\r\nRelated: #37667","created_at":"2015-03-14T11:10:16Z","updated_at":"2015-03-14T11:19:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3d0e220780913941aec667b501022d1d34d616b7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/37713/commits","review_comments_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/37713/comments","review_comment_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/issues/37713/comments","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/6871015d52d2d6060c0189cc9884ffb7ad9b8289","head":{"label":"DomT4:selfdestruct","ref":"selfdestruct","sha":"6871015d52d2d6060c0189cc9884ffb7ad9b8289","user":{"login":"DomT4","id":6998367,"avatar_url":"https://avatars.githubusercontent.com/u/6998367?v=3","gravatar_id":"","url":"https://api.github.com/users/DomT4","html_url":"https://github.com/DomT4","followers_url":"https://api.github.com/users/DomT4/followers","following_url":"https://api.github.com/users/DomT4/following{/other_user}","gists_url":"https://api.github.com/users/DomT4/gists{/gist_id}","starred_url":"https://api.github.com/users/DomT4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DomT4/subscriptions","organizations_url":"https://api.github.com/users/DomT4/orgs","repos_url":"https://api.github.com/users/DomT4/repos","events_url":"https://api.github.com/users/DomT4/events{/privacy}","received_events_url":"https://api.github.com/users/DomT4/received_events","type":"User","site_admin":false},"repo":{"id":23289808,"name":"homebrew","full_name":"DomT4/homebrew","owner":{"login":"DomT4","id":6998367,"avatar_url":"https://avatars.githubusercontent.com/u/6998367?v=3","gravatar_id":"","url":"https://api.github.com/users/DomT4","html_url":"https://github.com/DomT4","followers_url":"https://api.github.com/users/DomT4/followers","following_url":"https://api.github.com/users/DomT4/following{/other_user}","gists_url":"https://api.github.com/users/DomT4/gists{/gist_id}","starred_url":"https://api.github.com/users/DomT4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DomT4/subscriptions","organizations_url":"https://api.github.com/users/DomT4/orgs","repos_url":"https://api.github.com/users/DomT4/repos","events_url":"https://api.github.com/users/DomT4/events{/privacy}","received_events_url":"https://api.github.com/users/DomT4/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DomT4/homebrew","description":"The missing package manager for OS X.","fork":true,"url":"https://api.github.com/repos/DomT4/homebrew","forks_url":"https://api.github.com/repos/DomT4/homebrew/forks","keys_url":"https://api.github.com/repos/DomT4/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DomT4/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DomT4/homebrew/teams","hooks_url":"https://api.github.com/repos/DomT4/homebrew/hooks","issue_events_url":"https://api.github.com/repos/DomT4/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/DomT4/homebrew/events","assignees_url":"https://api.github.com/repos/DomT4/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/DomT4/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/DomT4/homebrew/tags","blobs_url":"https://api.github.com/repos/DomT4/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DomT4/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DomT4/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/DomT4/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DomT4/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/DomT4/homebrew/languages","stargazers_url":"https://api.github.com/repos/DomT4/homebrew/stargazers","contributors_url":"https://api.github.com/repos/DomT4/homebrew/contributors","subscribers_url":"https://api.github.com/repos/DomT4/homebrew/subscribers","subscription_url":"https://api.github.com/repos/DomT4/homebrew/subscription","commits_url":"https://api.github.com/repos/DomT4/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/DomT4/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/DomT4/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/DomT4/homebrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/DomT4/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/DomT4/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DomT4/homebrew/merges","archive_url":"https://api.github.com/repos/DomT4/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DomT4/homebrew/downloads","issues_url":"https://api.github.com/repos/DomT4/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/DomT4/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/DomT4/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/DomT4/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DomT4/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/DomT4/homebrew/releases{/id}","created_at":"2014-08-24T19:01:40Z","updated_at":"2015-03-13T23:09:12Z","pushed_at":"2015-03-14T11:09:09Z","git_url":"git://github.com/DomT4/homebrew.git","ssh_url":"git@github.com:DomT4/homebrew.git","clone_url":"https://github.com/DomT4/homebrew.git","svn_url":"https://github.com/DomT4/homebrew","homepage":"http://brew.sh","size":43214,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Homebrew:master","ref":"master","sha":"5b294757b211bc728e6f99be224ac0148fb1d459","user":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"repo":{"id":206084,"name":"homebrew","full_name":"Homebrew/homebrew","owner":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Homebrew/homebrew","description":"The missing package manager for OS X.","fork":false,"url":"https://api.github.com/repos/Homebrew/homebrew","forks_url":"https://api.github.com/repos/Homebrew/homebrew/forks","keys_url":"https://api.github.com/repos/Homebrew/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Homebrew/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Homebrew/homebrew/teams","hooks_url":"https://api.github.com/repos/Homebrew/homebrew/hooks","issue_events_url":"https://api.github.com/repos/Homebrew/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/Homebrew/homebrew/events","assignees_url":"https://api.github.com/repos/Homebrew/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/Homebrew/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/Homebrew/homebrew/tags","blobs_url":"https://api.github.com/repos/Homebrew/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Homebrew/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Homebrew/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/Homebrew/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/Homebrew/homebrew/languages","stargazers_url":"https://api.github.com/repos/Homebrew/homebrew/stargazers","contributors_url":"https://api.github.com/repos/Homebrew/homebrew/contributors","subscribers_url":"https://api.github.com/repos/Homebrew/homebrew/subscribers","subscription_url":"https://api.github.com/repos/Homebrew/homebrew/subscription","commits_url":"https://api.github.com/repos/Homebrew/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/Homebrew/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/Homebrew/homebrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/Homebrew/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/Homebrew/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Homebrew/homebrew/merges","archive_url":"https://api.github.com/repos/Homebrew/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Homebrew/homebrew/downloads","issues_url":"https://api.github.com/repos/Homebrew/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/Homebrew/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/Homebrew/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/Homebrew/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Homebrew/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/Homebrew/homebrew/releases{/id}","created_at":"2009-05-20T19:38:37Z","updated_at":"2015-03-14T06:06:25Z","pushed_at":"2015-03-14T06:06:25Z","git_url":"git://github.com/Homebrew/homebrew.git","ssh_url":"git@github.com:Homebrew/homebrew.git","clone_url":"https://github.com/Homebrew/homebrew.git","svn_url":"https://github.com/Homebrew/homebrew","homepage":"http://brew.sh","size":1465073,"stargazers_count":21867,"watchers_count":21867,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":10934,"mirror_url":null,"open_issues_count":359,"forks":10934,"open_issues":359,"watchers":21867,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/37713"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/37713"},"issue":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/37713"},"comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/37713/comments"},"review_comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/37713/comments"},"review_comment":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/37713/commits"},"statuses":{"href":"https://api.github.com/repos/Homebrew/homebrew/statuses/6871015d52d2d6060c0189cc9884ffb7ad9b8289"}}}}