homebrew-core/Formula/spaceship.rb

26 lines
923 B
Ruby

class Spaceship < Formula
desc "Zsh prompt for Astronauts"
homepage "https://spaceship-prompt.sh"
url "https://github.com/spaceship-prompt/spaceship-prompt/archive/v3.16.0.tar.gz"
sha256 "e686c0b78b3e5a52aa39a1c464e4d27db2ea6044912bda19b6483c515b4e715b"
license "MIT"
head "https://github.com/spaceship-prompt/spaceship-prompt.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, all: "1cc2130507db37752d18df060774e262ef4d3454c946f85a1078507e5e450e65"
end
depends_on "zsh" => :test
def install
libexec.install "spaceship.zsh", "lib", "sections"
zsh_function.install_symlink libexec/"spaceship.zsh" => "prompt_spaceship_setup"
end
test do
ENV["SPACESHIP_CHAR_SYMBOL"] = "🍺"
prompt = "setopt prompt_subst; autoload -U promptinit; promptinit && prompt -p spaceship"
assert_match ENV["SPACESHIP_CHAR_SYMBOL"], shell_output("zsh -c '#{prompt}'")
end
end