Create a gist now

Instantly share code, notes, and snippets.

Mac App Store .pkg file grabber
#!/bin/bash
appstorefolder=$TMPDIR/../C/com.apple.appstore
while true; do
packages=$(find $appstorefolder -type f -name "*.pkg")
for package in $packages
do
pkgname=$(basename "$package")
if [ -f "$HOME/Downloads/$pkgname" ]; then
continue
fi
echo "=== Found $package ==="
ln -h "$package" "$HOME/Downloads/$pkgname"
#pkgutil --payload-files $package | head -n 3
done
sleep 0.1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment