36 lines
1013 B
Ruby
36 lines
1013 B
Ruby
cask "powershell" do
|
|
arch arm: "arm64", intel: "x64"
|
|
|
|
version "7.3.2"
|
|
sha256 arm: "85813314b764a3b43c49e00a39eeb79c558c41bb3b6e72adf99e819a37105ed4",
|
|
intel: "60703630e29d5dbb8660ae164931a345319a62650105313abe174ce87eb05106"
|
|
|
|
url "https://github.com/PowerShell/PowerShell/releases/download/v#{version}/powershell-#{version}-osx-#{arch}.pkg"
|
|
name "PowerShell"
|
|
desc "Command-line shell and scripting language"
|
|
homepage "https://github.com/PowerShell/PowerShell"
|
|
|
|
livecheck do
|
|
url :url
|
|
regex(/^v?(\d+(?:\.\d+)+)$/i)
|
|
end
|
|
|
|
depends_on formula: "openssl"
|
|
depends_on macos: ">= :mojave"
|
|
|
|
pkg "powershell-#{version}-osx-#{arch}.pkg"
|
|
|
|
uninstall pkgutil: "com.microsoft.powershell"
|
|
|
|
zap trash: [
|
|
"~/.cache/powershell",
|
|
"~/.config/powershell",
|
|
"~/.local/share/powershell",
|
|
]
|
|
|
|
caveats <<~EOS
|
|
To use Homebrew in PowerShell, set:
|
|
Add-Content -Path $PROFILE.CurrentUserAllHosts -Value '$(#{HOMEBREW_PREFIX}/bin/brew shellenv) | Invoke-Expression'
|
|
EOS
|
|
end
|