homebrew-cask/Casks/m/miniconda.rb

48 lines
1.4 KiB
Ruby

cask "miniconda" do
arch arm: "arm64", intel: "x86_64"
version "py312_24.4.0-0"
sha256 arm: "f4925c0150d232d95de798a64c696f4b2df2745bb997b793506bdfd27bf91e11",
intel: "1413369470adb7cf52f8b961e81b3ceeb92f5931a451bef9cb0c42be0ce17ef3"
url "https://repo.anaconda.com/miniconda/Miniconda3-#{version}-MacOSX-#{arch}.sh",
verified: "repo.anaconda.com/miniconda/"
name "Miniconda"
desc "Minimal installer for conda"
homepage "https://docs.conda.io/en/latest/miniconda.html"
livecheck do
url "https://repo.anaconda.com/miniconda/"
strategy do |content|
sha256 = content.scan(/>Miniconda3-latest-MacOSX-#{arch}\.sh<.{,99}>(\w{64})</im).first.first
content.scan(/>Miniconda3-(py\d+_[\d.-]+)-MacOSX-#{arch}\.sh<.{,99}>#{sha256}</im).first.first
end
end
auto_updates true
conflicts_with cask: "miniforge"
container type: :naked
installer script: {
executable: "Miniconda3-#{version}-MacOSX-#{arch}.sh",
args: ["-b", "-p", "#{caskroom_path}/base"],
}
binary "#{caskroom_path}/base/condabin/conda"
uninstall delete: "#{caskroom_path}/base"
zap trash: [
"~/.conda",
"~/.condarc",
"~/.continuum",
]
caveats <<~EOS
Please run the following to setup your shell:
conda init "$(basename "${SHELL}")"
Alternatively, manually add the following to your shell init:
eval "$(conda "shell.$(basename "${SHELL}")" hook)"
EOS
end