5be0591644
Closes #44393. Signed-off-by: FX Coudert <fxcoudert@gmail.com>
31 lines
1.1 KiB
Ruby
31 lines
1.1 KiB
Ruby
class Transcrypt < Formula
|
|
desc "Configure transparent encryption of files in a Git repo"
|
|
homepage "https://github.com/elasticdog/transcrypt"
|
|
url "https://github.com/elasticdog/transcrypt/archive/v2.0.0.tar.gz"
|
|
sha256 "12b891bcee50c71f5ee00c3c3e992c591ad6146ece3d3c5efa065d966a010d65"
|
|
head "https://github.com/elasticdog/transcrypt.git"
|
|
|
|
bottle :unneeded
|
|
|
|
def install
|
|
bin.install "transcrypt"
|
|
man.install "man/transcrypt.1"
|
|
bash_completion.install "contrib/bash/transcrypt"
|
|
zsh_completion.install "contrib/zsh/_transcrypt"
|
|
end
|
|
|
|
test do
|
|
system "git", "init"
|
|
system bin/"transcrypt", "--password", "guest", "--yes"
|
|
|
|
(testpath/".gitattributes").atomic_write <<~EOS
|
|
sensitive_file filter=crypt diff=crypt
|
|
EOS
|
|
(testpath/"sensitive_file").write "secrets"
|
|
system "git", "add", ".gitattributes", "sensitive_file"
|
|
system "git", "commit", "--message", "Add encrypted version of file"
|
|
|
|
assert_equal `git show HEAD:sensitive_file --no-textconv`.chomp,
|
|
"U2FsdGVkX198ELlOY60n2ekOK1DiMCLS1dRs53RGBeU="
|
|
end
|
|
end
|