rcmdnk / homebrew-file

Brewfile manager for Homebrew
http://homebrew-file.readthedocs.io/
MIT License
356 stars 29 forks source link

Syntax issue with App Store apps #243

Closed thomey closed 11 months ago

thomey commented 11 months ago

Brew-file seems to have a syntax issue with apps from the App Store.

I add eg. appstore 409203825 'Numbers (13.2)' to my Brewfile, which is the syntax described in your docs.

On the first run of brew file install everything will work as expected, however at the end of the run Brew-file will automatically update the Brewfile to read mas 'Numbers (13.2)', id: 409203825.

This will break any future run of brew file install, as that syntax seems to be unsupported by Brew-file:

Error:

Installing id: Numbers
[WARNING] No id or wrong id information was given for AppStore App: id: Numbers.
Please install it manually.
rcmdnk commented 11 months ago

Thanks for the report. There was a bug for bundle type installation for mas, which makes above problem. It is fixed at v9.0.15.

There is another problem.

mas 'Numbers (13.2)', id: 409203825

This notation is bundle format.

If your Brewfile has quotes for the packages like:

tap 'homebrew/core'
brew 'awscli'
brew 'bash'
brew 'bash-completion'
...

then, brew-file assumes the file type as bundle.

If you did not give the format by -F (--form), brew-file tries to find format at the first line where the file type is distinguished.

Even if appstore 409203825 'Numbers (13.2)' is brew format, it is written out as bundle format if it is written in the bottom.

To avoid this issue, please remove quotes for packages (for brew, cask, tap). You don't need quotes for appstore, too.

tap homebrew/core
brew awscli
brew bash
brew bash-completion
...
appstore 409203825 Numbers (13.2)
thomey commented 11 months ago

Thanks @rcmdnk , removing the quotes solved it. Appreciate your work on this project and for your feedback! 🙌