Skip to content

Instantly share code, notes, and snippets.

@jacobsalmela
Created June 1, 2014 20:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacobsalmela/b6eb38c5ddd147f39645 to your computer and use it in GitHub Desktop.
Save jacobsalmela/b6eb38c5ddd147f39645 to your computer and use it in GitHub Desktop.
Saves Mac App Store packages if they are paused before finished downloading.
#!/bin/bash
appStoreFolder=$(sudo find /private/var/folders -type f -name "*.pkg")
i=0
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