zsh-history-substring-search: add caveat and test (#13567)

This commit is contained in:
Vithon 2017-05-17 07:53:12 -04:00 committed by FX Coudert
parent c4ef72100a
commit a17a49033b

View file

@ -7,7 +7,23 @@ class ZshHistorySubstringSearch < Formula
bottle :unneeded
def install
inreplace "README.md", "source zsh-history", "source #{opt_prefix}/zsh-history"
prefix.install Dir["*.zsh"]
pkgshare.install "zsh-history-substring-search.zsh"
end
def caveats
<<-EOS.undent
To activate the history search, add the following at the end of your .zshrc:
source #{HOMEBREW_PREFIX}/share/zsh-history-substring-search/zsh-history-substring-search.zsh
You will also need to force reload of your .zshrc:
source ~/.zshrc
EOS
end
test do
assert_match "i",
shell_output("zsh -c '. #{pkgshare}/zsh-history-substring-search.zsh && echo $HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS'")
end
end