Skip to content

Instantly share code, notes, and snippets.

@jeroenj
Created May 2, 2020 20:08
Show Gist options
  • Select an option

  • Save jeroenj/4fe05d859b560581983081f414e52f60 to your computer and use it in GitHub Desktop.

Select an option

Save jeroenj/4fe05d859b560581983081f414e52f60 to your computer and use it in GitHub Desktop.

Revisions

  1. jeroenj created this gist May 2, 2020.
    26 changes: 26 additions & 0 deletions chefdk.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    cask "chefdk" do
    version "3.13.1"
    sha256 "b3e1ef5e8050ea7c7118b9a983995a221e3427a1b4d1c7900b3147d8646e65cd"

    url "https://packages.chef.io/files/stable/chefdk/#{version}/mac_os_x/#{MacOS.version}/chefdk-#{version}-1.dmg"
    appcast "https://www.chef.io/chef/metadata-chefdk?p=mac_os_x&pv=#{MacOS.version}&m=x86_64&v=latest&prerelease=false"
    name "Chef Development Kit"
    name "ChefDK"
    homepage "https://downloads.chef.io/chefdk"

    depends_on macos: ">= :high_sierra"

    pkg "chefdk-#{version}-1.pkg"

    # As suggested in https://docs.chef.io/install_dk.html#mac-os-x
    uninstall_postflight do
    system_command "/usr/bin/find",
    args: ["/usr/local/bin", "-lname", "/opt/chefdk/*", "-delete"],
    sudo: true
    end

    uninstall pkgutil: "com.getchef.pkg.chefdk",
    delete: "/opt/chefdk/"

    zap trash: "~/.chefdk/"
    end