Skip to content

Instantly share code, notes, and snippets.

@n3r0-ch
Last active August 29, 2015 14:27
Show Gist options
  • Save n3r0-ch/61432269e1e62daed9ed to your computer and use it in GitHub Desktop.
Save n3r0-ch/61432269e1e62daed9ed to your computer and use it in GitHub Desktop.
Dump the Software on your Mac
#!/bin/bash
LOCATION="restore.sh"
#Change to script directory
cd `dirname "$0"`
#Dump Header
echo '#/bin/bash' > "restore.sh"
#Dump homebrew installion
echo 'ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"' >> "restore.sh"
#Dump update brew
echo 'brew update' >> "restore.sh"
echo 'brew upgrade' >> "restore.sh"
#Dump taps
brew tap | while read tap;
do
echo "brew tap $tap" >> "restore.sh"
done
#Dump brew
brew list | while read item;
do
echo "brew install $item" >> "restore.sh"
done
#Dump cask
brew cask list | while read item;
do
echo "brew cask install $item" >> "restore.sh"
done
#Dump app store
find /Applications -path '*Contents/_MASReceipt/receipt' -maxdepth 4 -print |\sed 's#.app/Contents/_MASReceipt/receipt#.app#g; s#/Applications/##' > appstore.txt
#Dump applications
ls /Applications > applications.txt
#Cleanup
echo 'brew cleanup' >> $LOCATION
echo 'brew cask cleanup' >> $LOCATION
git add -A
git commit -m "Automatically commited"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment