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.4.tar.gz"
sha256 "9e770029e78e0669031320b27e7614dea42547653c9bdc459f4f45c7627df0b2"
license "AGPL-3.0-or-later"
head "https://github.com/nojhan/liquidprompt.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, all: "234761fbf3860dc34cc0598ab22fa6c8c6c429ef245d788dfa648d09fbcc7517"
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/bash -c '. #{liquidprompt} --no-activate; lp_theme --list'")
assert_match "default\n", output
end
end