Simplify script/update_headers.

Partial #638

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
This commit is contained in:
Ross Goldberg 2024-11-16 00:56:52 -05:00
parent 53958a40c5
commit b96a0a71ba
No known key found for this signature in database

View file

@ -13,26 +13,18 @@ if ! cd -- "${mas_dir}"; then
exit 1
fi
main() {
check_class_dump
extract_private_framework_headers CommerceKit
extract_private_framework_headers StoreFoundation
}
check_class_dump() {
if ! command -v class-dump; then
echo 'class-dump is not installed.' >&2
echo 'Download from http://stevenygard.com/projects/class-dump/' >&2
exit 1
fi
}
if ! command -v class-dump; then
echo 'class-dump is not installed.' >&2
echo 'Download from http://stevenygard.com/projects/class-dump/' >&2
exit 1
fi
extract_private_framework_headers() {
local framework_name="${1}"
shift
local directory="Sources/PrivateFrameworks/${framework_name}"
mkdir -p "${directory}"
class-dump -Ho "${directory}" "/System/Library/PrivateFrameworks/${framework_name}.framework"
}
main
extract_private_framework_headers CommerceKit
extract_private_framework_headers StoreFoundation