Skip to content

Commit 0c7f781

Browse files
authored
Merge pull request #239885 from Homebrew/direnv
direnv: build for arm64_linux
2 parents 9f59772 + 7dd106d commit 0c7f781

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Formula/d/direnv.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,19 @@ class Direnv < Formula
1919
depends_on "bash"
2020

2121
def install
22+
ENV["CGO_ENABLED"] = OS.mac? ? "1" : "0"
2223
system "make", "install", "PREFIX=#{prefix}", "BASH_PATH=#{Formula["bash"].opt_bin}/bash"
2324
end
2425

2526
test do
26-
system bin/"direnv", "status"
27+
assert_match "No .envrc or .env found", shell_output("#{bin}/direnv status")
28+
29+
ENV["TEST"] = "failed"
30+
(testpath/".envrc").write "export TEST=passed"
31+
32+
assert_match "No .envrc or .env loaded", shell_output("#{bin}/direnv status")
33+
system bin/"direnv", "allow"
34+
35+
assert_match "passed", shell_output("#{bin}/direnv exec . sh -c 'echo $TEST'")
2736
end
2837
end

0 commit comments

Comments
 (0)