From d63f0012dd92aa92ef96304fe17e0fb821e1693a Mon Sep 17 00:00:00 2001 From: Jacob Bednarz Date: Tue, 5 Sep 2017 12:44:56 +1000 Subject: [PATCH] Clean out Homebrew package configuration files Updates `script/nuke` to account for moving Homebrew's package configuration files outside of `/opt/boxen`. See boxen/puppet-boxen#146 --- script/nuke | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/script/nuke b/script/nuke index 3dc52ffab2..6458df445b 100755 --- a/script/nuke +++ b/script/nuke @@ -6,27 +6,29 @@ unless ENV["USER"] == "root" exec "sudo", $0, *ARGV end -all = false -force = false -opt = false -services = false -receipts = false -gitconfig = false +all = false +force = false +opt = false +services = false +receipts = false +gitconfig = false +homebrew_config = false OptionParser.new do |o| - o.banner = "Remove most traces of Boxen from your machine." + o.banner = "Remove traces of Boxen from your machine." - o.on("--all", "Remove everything possible.") { all = true } - o.on("--force", "Actually do it.") { force = true } - o.on("--help", "Show this help.") { abort o.to_s } - o.on("--opt", "Remove /opt/boxen.") { opt = true } - o.on("--services", "Remove and unload services.") { services = true } - o.on("--receipts", "Remove package receipts used by Puppet.") { receipts = true } - o.on("--gitconfig", "Remove Boxen-provided git credential helper config.") { gitconfig = true } + o.on("--all", "Remove everything possible.") { all = true } + o.on("--force", "Actually do it.") { force = true } + o.on("--help", "Show this help.") { abort o.to_s } + o.on("--opt", "Remove /opt/boxen.") { opt = true } + o.on("--services", "Remove and unload services.") { services = true } + o.on("--receipts", "Remove package receipts used by Puppet.") { receipts = true } + o.on("--gitconfig", "Remove Boxen-provided git credential helper config.") { gitconfig = true } + o.on("--homebrew-config", "Remove Boxen managed Homebrew package configuration files.") { homebrew_config = true } o.parse! - abort o.to_s unless all || opt || services || receipts || gitconfig + abort o.to_s unless all || opt || services || receipts || gitconfig || homebrew_config end unless force @@ -64,3 +66,8 @@ if all || gitconfig warn "-> Removing git credential helper config." system "/usr/bin/git", "config", "--global", "--unset", "credential.helper" end + +if all || homebrew_config + warn "-> Removing Boxen managed Homebrew package configuration files." + system "rm", "-rf", "/etc/boxen" if force +end