Skip to content

Instantly share code, notes, and snippets.

@dardo82
Created February 19, 2022 02:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dardo82/c7b77e631797e2c1a5220bd90c5d7fce to your computer and use it in GitHub Desktop.
Save dardo82/c7b77e631797e2c1a5220bd90c5d7fce to your computer and use it in GitHub Desktop.
MAS install
#!/bin/sh
URL=$(curl -L -S -s $(gh repo view mas-cli/mas | awk -F '[()]' '/apple/{print $2}') | awk -F '"' '/updates/{print $4}')
curl -O $URL; hdiutil attach ${URL##*/}; sudo installer -target / -pkg /Volumes/${${URL##*/}%%.*}/${${URL##*/}%%.*}.pkg
hdiutil detach -verbose /Volumes/${${URL##*/}%.*}; rm -v ${URL##*/}; brew tap mas-cli/tap; brew install mas-cli/tap/mas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment