Skip to content

Instantly share code, notes, and snippets.

@vladimyr
Last active December 11, 2020 02:01
Show Gist options
  • Save vladimyr/1b522d7f1e34e272d99baa893ca4f454 to your computer and use it in GitHub Desktop.
Save vladimyr/1b522d7f1e34e272d99baa893ca4f454 to your computer and use it in GitHub Desktop.
Debugging homebrew casks

Export Proxyman certificate:

security find-certificate -a -c Proxyman -p >cert.pem

Inspect livecheck network traffic:

HOMEBREW_NO_ENV_FILTERING=1 SSL_CERT_FILE=cert.pem https_proxy=http://localhost:9090 brew livecheck --debug <formula>

Prepend cask with following block:

Homebrew.install_gem_setup_path! "pry"
Homebrew.install_gem_setup_path! "pry-byebug", executable: "pry"
Homebrew.install_gem! "pry-doc"
require "pry-byebug";

# https://coderwall.com/p/qp2aha/ruby-pbcopy-and-pbpaste

def pbcopy(input)
  str = input.to_s
  IO.popen('pbcopy', 'w') { |f| f << str }
  str
end

Put debugger statement at target spot:

binding.pry

Taken from: https://stevenharman.net/debugging-homebrew-with-pry-byebug#a-second-successful-attempt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment