DomT4 / homebrew-autoupdate

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

Cannot convert plist to json #6

Closed agross closed 7 years ago

agross commented 7 years ago

FYI, Clean My Mac 3 flags the plist as being broken:

$ plutil -convert json $HOME/Library/LaunchAgents/homebrew.mxcl.autoupdate.plist
/Users/you/Library/LaunchAgents/homebrew.mxcl.autoupdate.plist: Property List error: Encountered unknown ampersand-escape sequence at line 11 / JSON error: JSON text did not start with array or object and option to allow fragments not set.

I'm not sure whether the plist itself is broken or if Clean My Mac/plutil is. Even without trying to convert things it seems plutil considers the plist invalid:

$ plutil $HOME/Library/LaunchAgents/homebrew.mxcl.autoupdate.plist
/Users/you/Library/LaunchAgents/homebrew.mxcl.autoupdate.plist: Encountered unknown ampersand-escape sequence at line 11
agross commented 7 years ago

Seems like after replacing & with & using a text editor the errors go away.

DomT4 commented 7 years ago

Oh, yeah, it probably should be escaped. It doesn't seem to break the functionality, at least locally, but nonetheless a silly mistake. I'll push a fix for that tonight.

DomT4 commented 7 years ago

Thanks for the PR, and apologies for not accepting it. I decided to go down a different path in terms of not abusing the concept of plists to suit my laziness and treating this more like a system tool rather than simply a subordinate of the brew command.

Let me know if you've any further issues with the new version after a brew update, and thanks for the nudge to give this command some more love 😄.

agross commented 7 years ago

~/Library/Caches/com.github.domt4.homebrew-autoupdate will be considered a temporary directory by Clean My Mac. I don't know how many people actually use CMM, but when you run a default CMM cleanup without reviewing what will be deleted, it will break homebrew-autoupdate.

I's say ~/Library/com.github.domt4.homebrew-autoupdate is a better choice. What do you think?

DomT4 commented 7 years ago

Sigh. I hate trying to make package management work with third-party tools 😅. Package management by its nature is such an invasive thing to a system it's hard balancing usability with not upsetting other tools.

I could make that executable persistent with another plist but I guess I might as well do the simple thing and move it again.

DomT4 commented 7 years ago

Pushed more changes. Remember to brew update & then brew autoupdate --delete && brew autoupdate --start to get everything new in place. Now I await someone finding a new way to break the new changes, heh.

agross commented 7 years ago

Looking good from my point of view. Thank you very much!