Last active
December 17, 2020 09:05
-
-
Save sunnyyoung/43cc954c3c7b54bf36902ad9c2d91281 to your computer and use it in GitHub Desktop.
A shell function easy to unpack PKG file.
This file contains 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
# unpkg | |
# Usage: unpkg xxx.pkg | |
unpkg() { | |
filepath=$(dirname -- "$1") | |
filename=$(basename -- "$1") | |
input="$filepath/$filename" | |
output="$filepath/${filename%.*}" | |
pkgutil --expand $input $output | |
find $output -type f -name 'Payload' -exec tar -xf {} -C $filepath \; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment