110 Commits
Author SHA1 Message Date
apainintheneck b85f407e95 Only upgrade :latest casks when --greedy and the cask has been updated
A sha256 hash of the previous download is stored and compared with
new downloads before updating :latest casks. This prevents unnecessary
reinstalls when the cask hasn't been updated.

Move download path to cask from installer to prevent unnecessary
redownloads of casks.
2022-05-17 16:15:05 -07: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
Mike McQuaid 41e94afda5 Fix brew style
Fixes for https://github.com/Homebrew/brew/pull/12152.

Extracted into a separate PR so this can be merged immediately.
2021-09-30 10:13:53 +01:00
Rylan Polster c3a8b3841e Only include differring versions
Move the resetting of `MacOS.version` to an `ensure` block.

Fix the tests by adding a test OS and new fixture that has a
different version for that test OS.
2021-08-25 10:30:38 -04:00
Misty De Meo 5d5fb944d2 List spec: fix hardcoded library path 2021-06-15 21:24:50 -07:00
Mike McQuaid 1462f47609 cask/cmd/uninstall_spec: delete more flaky tests.
https://github.com/Homebrew/brew/pull/11337/checks?check_run_id=2528253674
2021-05-07 16:27:52 +01: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
Michael Cho a0261c4b39 cask uninstall script: allow tilde expansion to '$HOME' 2021-03-28 09:52:49 -07:00
Rylan Polster 665578438b test/cask/cmd/audit: fix tests again 2021-03-23 01:16:21 -04:00
Rylan Polster 0f9ca9dbbd test/cask/cmd/audit: fix style 2021-03-22 22:26:22 -04:00
Rylan Polster 83ebc5ef7e cask/audit: fix tests 2021-03-22 22:20:03 -04:00
Bo Anderson 8e98ce69f3 Stricter handling of CLI args 2021-03-18 16:41:57 +00:00
Issy Long e1ad07190e rubocop: Fix RSpec/ContextWording offenses
- For some of these I changed `context` to `describe` as it fit better
  rather than contriving a "when", "with" or "without", or massively
  restructuring the tests.
2021-02-19 23:30:41 +00:00
Carlos Álvaro 65d5c11f15 Update list_spec.rb for cask full_name 2021-02-08 13:20:41 +01:00
Carlos Álvaro 84d80cf0bf Add tap to cask json output 2021-02-08 13:20:40 +01:00
Carlos Álvaro 4f5f3824c6 Add full_token to cask json output 2021-02-08 13:20:40 +01: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 a427de5bee capitalization fixes
"curl" is the binary, while "cURL" is the umbrella project.
2021-01-26 15:36:44 -05:00
Mike McQuaidandGitHub 95c6e92d9b Merge pull request #10278 from zkokaja/add-cask-json-values
Add installed and outdated to cask json output
2021-01-25 10:04:25 +00:00
Seeker 8d24fb1367 Output string instead of array for installed cask version 2021-01-24 18:27:23 -08:00
Rylan Polster 7a0471f4c9 cask/cmd: fix tests 2021-01-23 17:50:41 -05:00
Rylan PolsterandGitHub 84af07f152 Merge pull request #10288 from Rylan12/refactor-named-args
Add named_args DSL for commands
2021-01-14 21:43:54 -05:00
Mike McQuaid 2f018d1a98 cask/cmd/info_spec: remove skipped test.
Unfortunately skipping this test makes it show up in the PR diff every
time. Let's just delete it for now instead.
2021-01-14 16:10:07 +00:00
Rylan Polster da811373d3 Add named_args DSL for commands 2021-01-13 17:09:42 -05:00
Misty De Meo 79aff82c39 Cask: skip test that is currently broken in master 2021-01-13 10:42:46 -08:00
Zaid Kokaja d98de86e76 Update expected test output to match new JSON 2021-01-09 23:17:47 -05: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
Markus Reiter 44cf1041ac Fix tests. 2020-12-16 09:45:58 +01:00
Markus Reiter 2552ecb1e7 Add missing requires for style spec. 2020-11-30 17:01:10 +01:00
Markus ReiterandGitHub 7dd7d69cd8 Merge pull request #9207 from reitermarkus/brew-zap
Add `--zap` flag for `brew uninstall`.
2020-11-20 09:42:13 +01:00
Markus Reiter c54a9937e7 Remove cask-specific checksum errors. 2020-11-19 19:46:59 +01:00
Markus Reiter 7a83f34dd1 Support casks in brew fetch. 2020-11-19 19:46:59 +01:00
Markus Reiter f4b4fdac98 Add brew zap command. 2020-11-19 13:42:02 +01:00
Markus Reiter 24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter 5f005f67cf Refactor global Cask::Config. 2020-10-01 00:57:10 +02:00
Markus Reiter c098ce5d16 Fix tests for cask audit. 2020-09-14 13:12:38 +02:00
Markus Reiter e5b56e485f Move cask audit implications into Audit. 2020-09-04 04:47:31 +02:00
Markus Reiter b9f3589ab7 Test casks are already tested covered brew style. 2020-09-01 19:26:46 +02:00
Markus Reiter b4d14c193f Use Homebrew::Style for brew cask style. 2020-09-01 18:34:26 +02:00
Bo Anderson e3372e2a14 Lazily require some heavy files 2020-08-20 02:05:17 +01:00
Mike McQuaid 3a91c37e66 Fix RuboCop checks. 2020-08-19 17:12:32 +01:00
William Ma 3918e13070 cask --cache: Deprecate command 2020-08-18 10:37:29 -04:00
Sean Molenaar 5d38cd7296 cask/list: fix artifact list 2020-08-14 23:12:17 +02:00
William Ma 2f68aad417 home: Deprecate brew cask home 2020-08-14 11:02:30 -04:00
Markus ReiterandGitHub 3b2a9c3b55 Merge pull request #8335 from waldyrious/show-cask-descs-in-info-command
Show cask description in `brew cask info` command
2020-08-14 00:52:27 +02:00
Waldir Pimenta 53932185e6 Show cask description as None if not present 2020-08-13 22:21:10 +01:00
Waldir Pimenta 619af6a723 Show cask description in brew cask info command 2020-08-13 22:21:10 +01:00
Waldir Pimenta efbfb90c42 Use cask with name for basic info command test
Also add non-dummy URL in the test fixture, to match the name, version, etc.
2020-08-13 22:21:10 +01:00
Markus Reiter b48bc316e0 Use CLI::Parser for cask commands. 2020-08-13 05:15:15 +02:00