26 lines
923 B
Ruby
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.1.tar.gz"
|
|
sha256 "e61e75f9534ec3de27b7e48e1e3f93be2d5a102da063f370a50cfd18c92b419e"
|
|
license "MIT"
|
|
head "https://github.com/spaceship-prompt/spaceship-prompt.git", branch: "master"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "bb64ffc3bdd3af35ba1cf05d938b2a04c5ef82404fba5ac62abdd91031f67bc5"
|
|
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
|