Skip to content

Instantly share code, notes, and snippets.

@yuya-maemichi-synspective
Last active June 13, 2024 11:25
Show Gist options
  • Save yuya-maemichi-synspective/582a9a0383779c5154cd0c346fdab2eb to your computer and use it in GitHub Desktop.
Save yuya-maemichi-synspective/582a9a0383779c5154cd0c346fdab2eb to your computer and use it in GitHub Desktop.
macOS software update
softwareupdate --fetch-full-installer --full-installer-version '13.6' &&
open '/Applications/Install macOS Ventura.app'
%x[softwareupdate --list]
.sub(/^[^:]*:\s*/,'')
.gsub(/\n\t/, ', ')
.split(/\n/)
.map{
_1
.scan(/(?<key>[^: ]+):\s*(?<value>[^,]+),\s*/)
.to_h
.transform_keys(&:to_sym)}
softwareupdate --list-full-installers |
sed 1,2d |
ruby -pe '$_=$_.strip.scan(/\W (\w+): ([\w .]+)/i).to_h.then{"%s %s-%s" % _1.values_at("Title","Version","Build")}+$/'
softwareupdate --list --no-scan |
sed '/Software Update Tool/,/Software Update [^:]*:/d;/ Label: /N;/\t/s!\n\t!, !'
softwareupdate --list |
grep -E 'Label: Safari|Title: Safari,' &&
softwareupdate --install --safari-only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment