Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle nil cask urls caused by unsupported macOS version #15943

Merged

Commits on Sep 3, 2023

  1. Handle nil urls in cask installer and API cask loader

    The goal here is to handle the case where a cask might have a nil
    url stanza because that cask is not available on the current version
    of macOS or the given architecture. This just moves those checks
    from the end of the `Cask::Installer#fetch` method to the beginning
    so that we don't try and download casks that are missing urls.
    
    This will now provide a helpful error message like so:
    ```
    Error: This software does not run on macOS versions older than Big Sur.
    ```
    
    Beyond that it no longer tries to run the url stanza with a nil value
    when loading casks from the API.
    apainintheneck committed Sep 3, 2023
    Configuration menu
    Copy the full SHA
    5138728 View commit details
    Browse the repository at this point in the history
  2. cmd/fetch: handle nil cask urls

    These urls can be nil if there is an unsatisfied macos version
    requirement. We check for false here because either the macos
    requirement can be satisfied and return true or can not be
    specified and return nil. If it's not specified, it means it
    can run on any macos version.
    
    The change in Cask::Download should provide better error messages
    in Downloadable but honestly we're better off just checking for
    the missing url higher up the call stack which is why I made
    the changes in the fetch command. Either way it seemed like
    a good idea while I'm here.
    apainintheneck committed Sep 3, 2023
    Configuration menu
    Copy the full SHA
    8c2f101 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    daa175e View commit details
    Browse the repository at this point in the history