Created
August 12, 2014 12:53
-
-
Save jacobsalmela/4239117c7f1cbc57cd80 to your computer and use it in GitHub Desktop.
(OS X) Save Mac App Store downloads as .pkgs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Jacob Salmela | |
# 2014-06-01 | |
#-------DESCRIPTION----------- | |
# smasp - Save Mac App Store Packages | |
#---------USAGE--------------- | |
# Pause each app or update that you want to save a package for | |
# Run this script | |
#-------VARIABLES------------- | |
appStoreFolder=$(sudo find /private/var/folders -type f -name "*.pkg") | |
# For loop incrementor | |
i=0 | |
#-------------------------------- | |
#----------BEGIN SCRIPT---------- | |
#-------------------------------- | |
for package in $appStoreFolder | |
do | |
# Make a hard link of the package in the Downloads folder | |
sudo ln $package ~/Downloads/_MAS_$i.pkg | |
# Increment by one in case there are more .pkgs to save | |
i=$(($i+1)) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment