Skip to content
This repository has been archived by the owner on May 22, 2018. It is now read-only.

Commit

Permalink
Clean out Homebrew package configuration files
Browse files Browse the repository at this point in the history
Updates `script/nuke` to account for moving Homebrew's package configuration files outside of `/opt/boxen`.

See boxen/puppet-boxen#146
  • Loading branch information
jacobbednarz committed Sep 26, 2017
1 parent e82b414 commit d63f001
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions script/nuke
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit d63f001

Please sign in to comment.