mas/script/update_headers
Chris Araman 64695e2457
📜 Lint
2021-03-28 14:12:02 -07:00

32 lines
753 B
Bash
Executable file

#!/bin/bash
#
# script/update_headers
# mas
#
# Runs class-dump to generate headers for Apple private frameworks.
#
main() {
check_class_dump
extract_private_framework_headers "CommerceKit"
extract_private_framework_headers "StoreFoundation"
}
check_class_dump() {
# command: usage: command [-pVv] command [arg ...]
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="PrivateFrameworks/${framework_name}"
mkdir -p "$directory"
class-dump -Ho "$directory" "/System/Library/PrivateFrameworks/${framework_name}.framework"
}
main