-
-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
postinstall only works with --verbose #1594
Comments
According to my read of homebrew-bundle/lib/bundle/brew_installer.rb Lines 139 to 145 in ac88e94
You cannot pass args to the postinstall as currently implemented and are only notified of its execution (and its output) when verbose is passed. But the docs indicate otherwise: Lines 45 to 46 in ac88e94
|
I'm able to reproduce this failure in the tests with this, but I'm not sure of the best way to address it. diff --git a/spec/bundle_utils_spec.rb b/spec/bundle_utils_spec.rb
index c2d5195..fddc18e 100644
--- a/spec/bundle_utils_spec.rb
+++ b/spec/bundle_utils_spec.rb
@@ -29,6 +29,24 @@
end
end
+ context "when passed a cmd with options" do
+ before(:example) do
+ @tmp = Tempfile.new('foo')
+ end
+ it "executes with verbose" do
+ described_class.system "/bin/bash -c touch #{@tmp.path}", verbose: true
+ expect(File.exist?(@tmp)).to be(true)
+ end
+ it "executes without verbose" do
+ described_class.system "/bin/bash -c touch #{@tmp.path}", verbose: false
+ expect(File.exist?(@tmp)).to be(true)
+ end
+ after(:example) do
+ @tmp.unlink
+ end
+
+ end
+
context "when checking for homebrew/cask", :needs_macos do
it "finds it when present" do
allow(File).to receive(:directory?).with("#{HOMEBREW_PREFIX}/Caskroom").and_return(true) The I think there are a couple of options:
|
ah that explains why I was confused whether this worked: #1555 (comment) Maybe worth making it report an error when the postinstall fails. |
Could also replace IO.popen with Open3. |
|
Thanks for the report @rrotter! Opened #1595 to fix.
We're now just always using
We already do, hence the error in the original issue body. |
Add a simple postinstall command to Brewfile:
brew "tig", postinstall: "/bin/ls -la"
Try to run the postinstall:
otoh,
brew bundle -v
works as expected.The text was updated successfully, but these errors were encountered: