homebrew-core/Formula/liquidprompt.rb

37 lines
1.2 KiB
Ruby

class Liquidprompt < Formula
desc "Adaptive prompt for bash and zsh shells"
homepage "https://github.com/nojhan/liquidprompt"
url "https://github.com/nojhan/liquidprompt/archive/v2.0.3.tar.gz"
sha256 "3b734c8d920ca94a24aa2ea5ff65218856b3a0c580bf45c2ec4b45918a18875b"
license "AGPL-3.0-or-later"
head "https://github.com/nojhan/liquidprompt.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, all: "3d340371ccc05ab79605f67c144681c8d36513d67573874d99236ba154cfbec3"
end
def install
share.install "liquidpromptrc-dist"
share.install "liquidprompt"
end
def caveats
<<~EOS
Add the following lines to your bash or zsh config (e.g. ~/.bash_profile):
if [ -f #{HOMEBREW_PREFIX}/share/liquidprompt ]; then
. #{HOMEBREW_PREFIX}/share/liquidprompt
fi
If you'd like to reconfigure options, you may do so in ~/.liquidpromptrc.
A sample file you may copy and modify has been installed to
#{HOMEBREW_PREFIX}/share/liquidpromptrc-dist
EOS
end
test do
liquidprompt = "#{HOMEBREW_PREFIX}/share/liquidprompt"
output = shell_output("/bin/sh -c '. #{liquidprompt} --no-activate; lp_theme --list'")
assert_match "default\n", output
end
end