mpanighetti / install-or-defer

A framework for prompting users of Jamf Pro-managed Macs to install Apple software updates.
Apache License 2.0
147 stars 28 forks source link

A slight typo when running the application on Big Sur #60

Closed vinulogy closed 2 years ago

vinulogy commented 2 years ago

When enforcing the update in Big Sur, the version is labelled twice.

Screen Shot 2021-09-24 at 8 21 51 AM
mpanighetti commented 2 years ago

Oh fun. The script is pulling the name and version of the update from the output of softwareupdate --list, and I'm guessing the name of the update is "macOS Big Sur 11.6", so it gets doubled up with the version column. Not sure if there's a good fix there, but if you could send over the full output of softwareupdate --list on a Mac with that update pending, I can reexamine the current text format and try to come up with a cleaner name/version capture.

vinulogy commented 2 years ago

Sure thing. Here you go!


Finding available software
Software Update found the following new or updated software:
* Label: Safari15.0BigSurAuto-15.0
    Title: Safari, Version: 15.0, Size: 119059K, Recommended: YES, 
* Label: macOS Big Sur 11.6-20G165
    Title: macOS Big Sur 11.6, Version: 11.6, Size: 2575888K, Recommended: YES, Action: restart, 

I don't know if it's possible, but a suggestion is maybe it can run an IF statement where if it detects 10.15.x, it'll run the current block of code. If it's 11.x.x, it'll omit the version column?

mpanighetti commented 2 years ago

Could do that, or maybe omit version if the Title column contains "macOS"?

mpanighetti commented 2 years ago

It's not perfect, but I've written logic to omit the Version column if the update report includes the string "macOS". Note that this means, in your example above, the Safari version string would also be left out, but I think this ultimately results in a cleaner summary for the purpose of inclusion in the alerts. Will put up a PR shortly if anyone wants to test it out.

mpanighetti commented 2 years ago

Fixed in #65, thanks for calling this out!