Closed fletchto99 closed 4 years ago
For context, brew bundle
itself parses the JSON output of brew info --installed --json=v1
, which is where this would have caused that output not to parse. 😄 https://github.com/Homebrew/homebrew-bundle/blob/master/lib/bundle/locker.rb#L80
Nice find! It would however be nice to still get the output for the env variable instead of just removing it.
Any output here will break brew bundle
. Is there a reason its needs to be output? Perhaps it could be output during the install instead?
Not informed in exact reason for printing / usage it there, I would guess it was handy. The output is good when debugging the travis integration. If we can print it during install, it would be fine. lets ask @merlokk if the output was used in any homebrew tests.
Printing during install would be a lot safer than printing it at load-time! You could also guard the puts
so it only prints if that variable is set. Printing to stderr
would also be a bit safer, to avoid polluting the stream of something else that's consuming machine-readable output from stdout
like what happened here.
Looking forward to see the PR become enhanced with @mistydemeo 's suggestion
Merlokk was fine with removing this output.
Thanks for this find and fix!
Having output in the
head
can causebrew bundle
to break. For example, I've got an application setup locally which loads formulas into to JSON viabrew bundle
. Since I had this formula tapped when loaded it would output viaputs
theTRAVIS_COMMIT
env variable into the output making the json invalid causing the application setup viabrew bundle
to fail.