Skip to content

Commit fa883a4

Browse files
committed
test_commit_email.rb: Simply use sh
`env` on macOS resets DYLD environment variables that are needed to run ruby configured with `--enable-load-relative`. Use simple commands instead, and `/bin/sh` that is specified in POSIX is more portable than `/usr/bin/env`.
1 parent b868bee commit fa883a4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tool/test/test_commit_email.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ def setup
2020
end
2121

2222
@sendmail = File.join(Dir.mktmpdir, 'sendmail')
23-
File.write(@sendmail, <<~SENDMAIL)
24-
#!/usr/bin/env ruby
25-
print #{STDIN_DELIMITER.dump}
26-
puts STDIN.read
23+
File.write(@sendmail, <<~SENDMAIL, mode: "wx", perm: 0755)
24+
#!/bin/sh
25+
echo #{STDIN_DELIMITER.chomp.dump}
26+
exec cat
2727
SENDMAIL
28-
FileUtils.chmod(0755, @sendmail)
2928

3029
@commit_email = File.expand_path('../../tool/commit-email.rb', __dir__)
3130
end

0 commit comments

Comments
 (0)