234 Commits

Author SHA1 Message Date
apainintheneck
47b3f6fe6e Stop including/extending search.rb
- Instead use class methods.
- This is better than use it as a mixin
  when only a small number of methods are
  used in each class or module.
- It also allows us to conditionally
  require it in `brew install`.
- Removed unused search require in descriptions.rb.
2022-12-17 11:08:13 -08:00
apainintheneck
c477b9aab3 Cleanup after adding os specific rubocop
- Change name of rubocop warning
- Disable linting on remaining offending lines
- Add todos to move lines with disabled linting
  checks to extend/os in the future
2022-11-29 23:13:50 -08:00
Daniel Bayley
b9ee9b868d Fix install <cask> --dry-run 2022-11-11 17:33:11 +00:00
Ian Gregory
a0f915169c Remove --adopt switch from reinstall and upgrade 2022-10-25 19:07:21 -04:00
Ian Gregory
a715dec49d Add --adopt switch
Allows `brew install` & co. to adopt existing cask artifacts that are
identical to those being installed.

Discussion: #14006
2022-10-21 23:28:51 -04:00
Bo Anderson
eac32f0b20
Additional fixes for Ruby 3 compatibility 2022-10-18 01:54:59 +01:00
Bo Anderson
9b99594753
Preliminary compatibility fixes for Ruby 3 2022-10-11 02:53:27 +01:00
hyuraku
374dd3dea2 repair if syntax and remove useless line 2022-08-27 22:29:07 +09:00
hyuraku
b61ae59421 repair syntax 2022-08-19 21:43:57 +09:00
hyuraku
1bfcf314ac repair style 2022-08-18 00:16:11 +09:00
hyuraku
8a7f445d1f repair how to show casks to be installed 2022-08-17 22:14:05 +09:00
hyuraku
93ebe42a72 add dry-run option to cask#install 2022-08-16 21:00:45 +09:00
Sean Molenaar
cc61a759ed
Merge pull request #13627 from SMillerDev/feature/cask/signing_check
cask: add audit for incorrect signing
2022-08-16 10:51:59 +02:00
fn ⌃ ⌥
a208ea9c92 info: highlight package name 2022-08-15 07:47:52 -07:00
Sean Molenaar
e90371f8ab
cask: add audit for incorrect signing 2022-08-11 09:11:29 +02:00
Bevan Kay
1f43bf32a4
cask: add statement when upgrade won't be installed 2022-05-26 10:06:58 +10:00
Mike McQuaid
94148c3bc8
Fix handling unreadable casks
When casks are unreadable (e.g. have invalid syntax, the cask file
cannot be found) then it's not been possible to uninstall them, list
them or perform any operation which iterates through all casks.

Handle these various cases by falling back to creating a `Cask::Cask`
object using just the name/token and latest installed version on disk.

This provides enough functionality to be able to verbosely list these
casks, not error on listing and, most importantly, uninstall/reinstall
them.

Fixes https://github.com/Homebrew/homebrew-cask/issues/62223
2022-05-16 17:27:13 -04:00
xxyzz
1b877273d8
Don't print Cask installed error message when --quiet is used 2022-05-11 11:03:20 +08:00
Issy Long
0b6b2f04da
cask/reinstall: Support --zap for entirely purging cask files
- The `brew uninstall` command has `--zap`, so let's make `brew
  reinstall` have parity here for a better user experience. (Requested
  in issue 12983.)
- It feels weird that to get my new reinstall test to pass I had to add
  `--zap` to `cask/cmd/install.rb`, not `cask/cmd/reinstall.rb` to get
  the tests to pass. But the `brew reinstall --cask caffeine --zap`
  command worked fine all the time. The CLI argument parser from the
  test run was complaining about not knowing what `zap` was. As a
  result, `--zap` now shows up as a switch in `brew install --help`
  which I'm not 100% convinced is the desired UX. But I've edited the
  description accordingly to specify that it will only work on
  `reinstall` operations (and `--zap` on `install` is a no-op).

```
issyl0 at pictor in /opt/homebrew on reinstall-cask-zap
❯ brew reinstall --cask caffeine --zap
==> Downloading https://github.com/IntelliScape/caffeine/releases/download/1.1.3/Caffeine.dmg
Already downloaded: /Users/issyl0/Library/Caches/Homebrew/downloads/3d6ccfdd3b8d0ab37d1c2468d6e69078c2d31d3b12bf51947c4db21e5f376af2--Caffeine.dmg
==> Implied `brew uninstall --cask caffeine`
==> Backing App 'Caffeine.app' up to '/opt/homebrew/Caskroom/caffeine/1.1.3/Caffeine.app'
==> Removing App '/Applications/Caffeine.app'
==> Dispatching zap stanza
==> Trashing files:
~/Library/Application Support/com.intelliscapesolutions.caffeine
~/Library/Preferences/com.intelliscapesolutions.caffeine.plist
~/Library/Caches/com.intelliscapesolutions.caffeine
~/Library/HTTPStoages/com.intelliscapesolutions.caffeine.binarycookies
==> Removing all staged versions of Cask 'caffeine'
==> Installing Cask caffeine
==> Moving App 'Caffeine.app' to '/Applications/Caffeine.app'
🍺  caffeine was successfully installed!
```
2022-04-09 16:37:23 +01:00
Rylan Polster
2e6b6ab3a2
Fix style 2021-12-24 21:15:21 -05:00
fn ⌃ ⌥
8dc060c88b upgrade: use greedy_* method parameters 2021-09-21 11:45:49 -07:00
hyuraku
e44ac800c2 repair cask install quiet mode 2021-09-10 23:12:52 +09:00
FnControlOption
eb16e10902 messages: record cask installations.
This is used to record installation times and also to determine
whether to display caveats.
2021-09-02 08:44:00 -07:00
FnControlOption
278c06f31d upgrade: deduplicate cask caveats.
Cask::Installer.caveats invokes Homebrew.messages.record_caveats
so only invoke it once and store the return value.
2021-09-02 08:43:56 -07:00
EricFromCanada
c234d1ea03
upgrade: list upgradeable dependencies/migrations/cleanups on dry run 2021-08-31 12:27:14 -04:00
Bevan Kay
88edb1c64b
fix style 2021-07-04 17:25:03 +10:00
Bevan Kay
9cf0a7409b
fix style 2021-07-03 11:58:16 +10:00
Bevan Kay
507fba73c4
update command line outputs 2021-07-03 11:57:32 +10:00
Bevan Kay
85082066f2
fix style 2021-07-01 23:02:15 +10:00
Bevan Kay
b1c70160f3
Split into two flags --greedy-latest and --greedy-auto-updates 2021-07-01 23:01:22 +10:00
Bevan Kay
72e3704827
update style 2021-06-30 11:21:24 +10:00
Bevan Kay
057b3a3502
adds an option to skip unversioned casks in outdated and upgrade command 2021-06-30 11:13:21 +10:00
Nanda H Krishna
47a549e944
Fix style using brew style --fix 2021-06-02 11:43:16 +05:30
hyuraku
45b7e438f1 repair manual_installer_casks block 2021-05-15 21:24:24 +09:00
hyuraku
5f62f417fd add error message that cask was installed manually 2021-05-14 12:56:57 +09:00
hyuraku
bc476a31b4 remove manual installer casks from upgrage casks 2021-05-12 23:46:50 +09:00
Mike McQuaid
6f071a06f8
Use JSON.pretty_generate
It's dramatically more human readable for very little difference in
space.
2021-04-09 15:44:37 +01:00
Markus Reiter
72a79d934e
Fix audit annotations for casks. 2021-04-03 04:27:32 +02:00
Rylan Polster
2b8d19e0bd
audit: limit non-failure cask output 2021-03-22 22:16:54 -04:00
Bo Anderson
32d532fb49
cmd/list: fix Cask listing 2021-03-22 16:21:02 +00:00
Bo Anderson
8e98ce69f3
Stricter handling of CLI args 2021-03-18 16:41:57 +00:00
Mike McQuaid
d6957a3acb
Homebrew 3.0.0 deprecations/disables 2021-01-29 19:50:24 +00:00
EricFromCanada
6fc116318e fixes for grammar and wording 2021-01-26 16:19:47 -05:00
EricFromCanada
99ad3350ee use single quotes around stanza and parameter names 2021-01-26 16:19:47 -05:00
EricFromCanada
a427de5bee capitalization fixes
"curl" is the binary, while "cURL" is the umbrella project.
2021-01-26 15:36:44 -05:00
EricFromCanada
d0ad829e43 use arrow character for UI prompts 2021-01-26 15:36:43 -05:00
Seeker
fbafaff4fe rubocop: require braces for Sorbet sig 2021-01-18 16:52:45 -08:00
Seeker
f476bcafcb upgrade: show formula caveats after casks have been updated 2021-01-11 11:43:11 -08:00
Seeker
b9854bd4cf rubocops: add unless_multiple_conditions 2021-01-08 10:33:54 -08:00
Mike McQuaid
d8a5e467e8
audit: quieten down and make casks audit consistent with formulae.
The current casks audit is very noisy in the no-op case (i.e. no errors)
https://github.com/Homebrew/brew/pull/10234/checks?check_run_id=1655630568#step:15:7

This means when there are errors and you're querying all casks it's
pretty hard to quickly identify the problems.

This commit silences the `passing`, `warning` and header/summary output
when you're querying all casks (rather than a specific cask or tap).

This is more consistent with `brew audit` for formulae which is silent
unless there are audit failures.
2021-01-07 13:31:14 +00:00