Skip to content

Commit badfce3

Browse files
authored
reduce: implement post_install to clean up a file (#2162)
1 parent f4a2eb2 commit badfce3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Formula/reduce.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,23 @@ def install
4848
chmod 0644, site_packages/"reduce.py"
4949
end
5050

51+
def post_install
52+
# Remove mislocated reduce_wwPDB_het_dict.txt
53+
# TODO: Remove this block after upstream PR (https://github.com/rlabduke/reduce/pull/66) is merged
54+
rm "#{prefix}/reduce_wwPDB_het_dict.txt"
55+
end
56+
5157
test do
5258
resource "homebrew-testdata" do
5359
url "https://files.rcsb.org/download/3QUG.pdb"
5460
sha256 "7b71128bedcd7ebdea42713942a30af590b3cf514726485f9aa27430c3999657"
5561
end
5662

57-
output = shell_output(bin/"reduce -Version 2>&1", 2)
63+
output = shell_output("#{bin}/reduce -Version 2>&1", 2)
5864
assert_match "reduce.4.15.250408", output
5965
resource("homebrew-testdata").stage testpath
60-
system("#{bin}/reduce -NOFLIP -Quiet 3qug.pdb > 3qug_h.pdb")
61-
assert_match "add=1978, rem=0, adj=70", File.read("3qug_h.pdb")
66+
system("#{bin}/reduce -NOFLIP -Quiet 3QUG.pdb > 3QUG_H.pdb")
67+
assert_match "add=1978, rem=0, adj=70", File.read("3QUG_H.pdb")
6268

6369
# Check if the Python module can be imported
6470
system "python3", "-c", "import reduce"

0 commit comments

Comments
 (0)