homebrew-core/Formula/yadm.rb
Tim Byrne 1ffa86e982 yadm 1.12.0 (#19830)
install zsh completions
2017-10-25 23:36:24 -07:00

34 lines
1.2 KiB
Ruby

class Yadm < Formula
desc "Yet Another Dotfiles Manager"
homepage "https://thelocehiliosan.github.io/yadm/"
url "https://github.com/TheLocehiliosan/yadm/archive/1.12.0.tar.gz"
sha256 "c3d612d01e2027d5f457e0f7d120bc67251b716c373d99fe70638bd86edf107f"
bottle :unneeded
def install
bin.install "yadm"
man1.install "yadm.1"
bash_completion.install "completion/yadm.bash_completion"
zsh_completion.install "completion/yadm.zsh_completion" => "_yadm"
end
test do
system bin/"yadm", "init"
assert_predicate testpath/".yadm/repo.git/config", :exist?, "Failed to init repository."
assert_match testpath.to_s, shell_output("#{bin}/yadm gitconfig core.worktree")
# disable auto-alt
system bin/"yadm", "config", "yadm.auto-alt", "false"
assert_match "false", shell_output("#{bin}/yadm config yadm.auto-alt")
(testpath/"testfile").write "test"
system bin/"yadm", "add", "#{testpath}/testfile"
system bin/"yadm", "gitconfig", "user.email", "test@test.org"
system bin/"yadm", "gitconfig", "user.name", "Test User"
system bin/"yadm", "commit", "-m", "test commit"
assert_match "test commit", shell_output("#{bin}/yadm log --pretty=oneline 2>&1")
end
end