DomT4 / homebrew-autoupdate

:tropical_drink: An easy, convenient way to automatically update Homebrew.
BSD 2-Clause "Simplified" License
987 stars 54 forks source link

feat(start): respect `HOMEBREW_CASK_OPTS` env #69

Closed buschtoens closed 3 years ago

buschtoens commented 3 years ago

😷 Fix the macOS Quarantine

My half-assed attempt at trying to fix the annoying macOS quarantine "The app can’t be opened because it is from an unidentified developer" error.

How

Respecting the HOMEBREW_CASK_OPTS env var, just like some other env vars are already respected.

As discussed in https://github.com/Homebrew/homebrew-autoupdate/issues/66#issuecomment-890227342. Based on the information from https://github.com/Homebrew/homebrew-cask/blob/HEAD/USAGE.md#options.

Usage Example

# Automatically upgrade every 12 hours, including the `--no-quarantine` flag to
# avoid annoying macOS quarantine warnings.
HOMEBREW_CASK_OPTS="--no-quarantine" brew autoupdate start 43200 --upgrade

TODO

Alternatives

Even when going with an alternative approach, I think respecting HOMEBREW_CASK_OPTS is worthwile either way.

DomT4 commented 3 years ago

This seems sensible too, good catch/resolution.

DomT4 commented 3 years ago

Thank you @buschtoens!