ninxsoft / mist-cli

A Mac command-line tool that automatically downloads macOS Firmwares / Installers.
MIT License
610 stars 29 forks source link

'13' as invalid search string #131

Closed aschwanb closed 1 year ago

aschwanb commented 1 year ago

Mist does fail to download a valid installer if only the main OS version is give. I'm not sure if this is intentional or not. However, it used to work and it currently breaks other tools (like erase-install) which expect this to work.

Version

% mist --version
1.11 (Latest: 1.11)

Command

sudo mist download installer 13 application --application-name "Install %NAME%.app" --output-directory /Applications --no-ansi  

Expected

mist does download the latest version of macOS 13. (13.3.1 in this case)

Actual

mist does fail with No macOS Installer found with '13', exiting

% sudo mist download installer 13 application --application-name "Install %NAME%.app" --output-directory /Applications --no-ansi  
Password:
┌──────────────────┐
│ INPUT VALIDATION │
└──────────────────┘
  ├─ User is 'root'...
  ├─ Download search string will be '13'...
  ├─ Include betas in search results will be 'false'...
  ├─ Only include compatible installers will be 'false'...
  ├─ Cache downloads will be 'false'...
  ├─ Output directory will be '/Applications'...
  ├─ Temporary directory will be '/private/tmp/com.ninxsoft.mist'...
  ├─ Force flag has not been set, existing files will not be overwritten...
  ├─ Application name will be 'Install %NAME%.app'...
┌────────┐
│ SEARCH │
└────────┘
  ├─ Searching for macOS download '13'...
  └─ No macOS Installer found with '13', exiting...
ninxsoft commented 1 year ago

@aschwanb Nice catch - looks like this bug was introduced when we attempted to filter on exact matches only: #122

Investigating a way forward that strike a happy balance between exact / fuzzy matching, stay tuned 👍

ninxsoft commented 1 year ago

In the interim, can you move forward with the following?

sudo mist download installer ventura application --application-name "Install %NAME%.app" --output-directory /Applications --no-ansi
grahampugh commented 1 year ago

I don't think that macOS 13 is ever a specific version - it's 13.0. So the logic could probably see if there's any dot in the search string and if so, treat it as an exact search, whereas if not, go for the latest available.

aschwanb commented 1 year ago

In the interim, can you move forward with the following?

sudo mist download installer ventura application --application-name "Install %NAME%.app" --output-directory /Applications --no-ansi

For the record: This works as intended: Found [032-66588] macOS Ventura 13.3.1 (22E261) [2023-04-17]

ninxsoft commented 1 year ago

@aschwanb + @grahampugh looks like the fix was more trivial than expected: #132