190 Commits

Author SHA1 Message Date
Mike McQuaid
2082379a61
Revert "help: print cli/parser help message if used" 2020-02-02 09:11:23 +01:00
Mike McQuaid
b03efb4356
Move shared man/help logic to cli/parser. 2020-02-01 19:05:03 +01:00
Dawid Dziurla
e9274b3827
help: print cli/parser help message if used 2020-01-26 18:33:13 +01:00
Jonathan Chang
d76c7f2380 brew.rb: update Ruby version check 2019-11-04 21:06:27 +11:00
Mike McQuaid
c4f72312ce
Fixup brew style failures. 2019-04-30 09:19:18 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
7ab5fef7f2
brew.rb: remove unless ||. 2019-04-19 10:12:03 +09:00
Michka Popoff
49aad7ddb3 brew: remove sudo call only in docker context
Follow up from #6018
2019-04-18 17:16:05 +02:00
Michka Popoff
1c016ecee7 brew: remove sudo call
except for "brew services" command
2019-04-16 20:35:41 +02:00
Mike McQuaid
a679ec1cb3
Revert "brew: remove sudo call" 2019-04-12 08:29:07 +01:00
Mike McQuaid
d12e39633c
Remove odisabled. 2019-04-01 15:07:50 +01:00
Michka Popoff
583a754d9f brew: remove sudo call
Closes #5865
2019-03-24 17:53:39 +01:00
Mike McQuaid
b3c33d6d51
brew.*: run Bundler immediately when needed.
This is needed to avoid gem conflicts when `global.rb` is loaded for some commands.
2019-02-21 12:56:22 +00:00
Mike McQuaid
d64429a736
rubocop: enable Style/IfUnlessModifier. 2019-02-21 12:55:49 +00:00
Mike McQuaid
948b367ac3
brew.rb: don't try to uninstall brew-cask keg.
This is long gone at this point so no need to keep this code around.
2019-02-13 15:43:17 +00:00
Mike McQuaid
9b5ab7fbb7
Merge pull request #5598 from MikeMcQuaid/odeprecated-odisabled
Update deprecations and cleanup
2019-01-27 12:13:26 +00:00
Mike McQuaid
eed1444d61
Update deprecations and cleanup
- Move `odeprecated` to `odisabled`
- Remove `odisabled`
- Enable automatic cleanup on install/reinstall/upgrade.
2019-01-23 21:57:40 +00:00
Mike McQuaid
57d7d4c9dd
brew.rb: duplicate MissingEnvironmentVariables exception.
Fixes #5592.
2019-01-23 15:40:44 +00:00
Mike McQuaid
63cfb0ff61
Better handle missing environment variables when updating
Try to re-exec the Homebrew binary to get the environment variables we
need and give up if that doesn't work.
2019-01-12 15:59:08 +00:00
Mike McQuaid
170c5493a4
Update deprecations
- Add some `odeprecated`
- Make some `odeprecated` now `odisabled`
- Remove `odisabled` code.
- Remove old update migrations
- Remove GCC 4.0 compiler
- Remove Tiger-only code
- Remove 32-bit-only code
- Remove use of LD64
- Remove GCC 4.3 - 4.8 support.
2019-01-08 19:13:46 +00:00
EricFromCanada
baf75af908 brew: prepend shims to PATH used by _system
Ensures `system` and `safe_system` use brewed git if available.
2018-10-26 23:47:59 -04:00
Markus Reiter
c4d418e126 Use ActiveSupport’s #second. 2018-10-07 23:10:56 +02:00
Markus Reiter
7a991985a4 Run tests with HOMEBREW_DEVELOPER unset. 2018-09-19 19:43:45 +02:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Markus Reiter
516a39f5a4 Move migrations into UpdateMigrator module. 2018-08-31 16:51:23 +02:00
Mike McQuaid
40fc520a45 brew.rb: only output "Kernel.exit" in debugging mode.
This doesn't seem to make sense for `--verbose`.
2018-08-16 09:58:39 +01:00
Markus Reiter
e6b45842e8 Refactor odeprecated. 2018-08-15 12:16:02 +02:00
Markus Reiter
5841b992ac Refactor $LOAD_PATH. 2018-07-17 23:38:57 +02:00
Markus Reiter
18e46b3ec2 Fix usage of HOMEBREW_LOAD_PATH. 2018-06-18 16:23:35 +02:00
Markus Reiter
42e34db562 Always add cask/lib to $LOAD_PATH. 2018-06-07 18:42:30 +02:00
Andrew Janke
8b55cb5ecb Refactor commands to remove "require cmd/help" 2018-06-07 04:59:59 -04:00
Markus Reiter
c53a52daee Move --version logic into cmd/--version.rb. 2018-05-21 05:35:44 +02:00
Mike McQuaid
9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
Dan Wendorf
151c2861ac Custom commands can show help
We attempted to find the help message for commands before loading custom
commands in the path.
2017-11-18 17:04:54 -08:00
Mike McQuaid
7a68b4a3f9 Refactor command handling code
Don’t rely on having external commands always present in the PATH in
order to find them. Instead, provide an accessory method to Tap so
they can be added and used when needed.

While we’re here, do some general refactoring and cleanup of the
command code in these places.
2017-11-05 15:37:57 +00:00
Mike McQuaid
29f81812cc brew.rb: cleanup PATH setup.
Avoid adding all the tap commands to the PATH when not necessary.
2017-11-03 14:50:17 +00:00
Markus Reiter
632fdca2d4 Merge pull request #3306 from amyspark/hacktoberfest-quash-cask-help
Fixes querying Cask commands' help
2017-10-24 20:54:24 +02:00
L. E. Segovia
09e26b1152 brew style fixes 2017-10-24 10:17:11 -03:00
L. E. Segovia
2bfc7904fb Simplify cask help check 2017-10-24 08:04:49 -03:00
L. E. Segovia
75de4db003 Let Cask handle the -h flag 2017-10-20 16:51:26 -03:00
L. E. Segovia
16faf6fca9 Shorten HOMEBREW_HELP set/unset 2017-10-18 08:47:52 -03:00
L. E. Segovia
098305e679 Correct setting and deleting HOMEBREW_HELP
(and also delete the extra help_flag case, it's no longer needed)
2017-10-18 08:37:24 -03:00
L. E. Segovia
fd2b0d21c4 Only unset HOMEBREW_HELP before issuing the tap 2017-10-18 08:30:26 -03:00
Ash Furrow
11572c749b
Specifies which errant version of Ruby is used in raise. 2017-10-17 17:24:04 -04:00
L. E. Segovia
0998e16e81 Fix mistaken &
I meant to verify that both a cmd and a help flag were received from the
shell
2017-10-12 11:20:04 -03:00
L. E. Segovia
d1262868a9 Fixes help querying
- If a non-existent command with a flag is queried to Cask, the latter
is printed instead of the command
 - If the help from a not-yet-tapped cask's command is queried, it
prints brew tap's help infinitely

Fixes caskroom/homebrew-cask#28977
2017-10-12 00:11:11 -03:00
Markus Reiter
175ca909ee Clean up code style and remove .rubocop_todo.yml. 2017-10-08 16:10:37 +02:00
Mike McQuaid
bcca2a7c6b brew: handle Ruby 2.3 more gracefully.
- `brew.rb` needed updated to fail unless on Ruby 2.3
- `brew update` should unset `HOMEBREW_RUBY_PATH` to ensure that this
  doesn't "stick" on a Ruby 2.0 version after a portable Ruby has been
  installed.
2017-09-29 19:53:50 +01:00
Mike McQuaid
cf5fdeef1d Rubocop: manual rule fixes. 2017-09-24 21:23:59 +01:00
Mike McQuaid
cb3a47d9e2 Fix brew tests on High Sierra.
The `brew test` tests were failing as they were unable to include
`test/unit/assertions`. This is because it's a gem and we were setting
the `GEM_HOME` so system gems were being ignored.

While I was there and examining the `$LOAD_PATH`: reduce the number of
things we add there by using `Bundler.with_clean_env` and only adding
`HOMEBREW_LIBRARY_PATH` in the `$LOAD_PATH` if it isn't already there
(which it always is [and has to be] for integration tests).

This also seems to have the side effect of speeding up integration
tests from 1m26s to 1m8s on my machine.
2017-07-07 15:20:19 +01:00