mirror of
https://github.com/mas-cli/mas
synced 2024-11-24 20:43:10 +00:00
ea26b72d91
Partial #638 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
30 lines
825 B
Bash
Executable file
30 lines
825 B
Bash
Executable file
#!/bin/bash
|
|
#
|
|
# script/update_headers
|
|
# mas
|
|
#
|
|
# Runs class-dump to generate headers for Apple private frameworks.
|
|
#
|
|
|
|
mas_dir="$(readlink -fn "$(dirname "${BASH_SOURCE:-"${0}"}")/..")"
|
|
|
|
if ! cd -- "${mas_dir}"; then
|
|
printf $'Error: Could not cd into mas directory: %s\n' "${mas_dir}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if ! command -v class-dump >/dev/null; 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}"
|
|
local directory="Sources/PrivateFrameworks/${framework_name}"
|
|
mkdir -p "${directory}"
|
|
class-dump -Ho "${directory}" "/System/Library/PrivateFrameworks/${framework_name}.framework"
|
|
}
|
|
|
|
extract_private_framework_headers CommerceKit
|
|
extract_private_framework_headers StoreFoundation
|