-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·30 lines (24 loc) · 1017 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# Binaries
basename="/usr/bin/basename"
dirname="/usr/bin/dirname"
munkipkg="/usr/local/munki-pkg/munkipkg"
PlistBuddy="/usr/libexec/PlistBuddy"
python3="/Library/ManagedFrameworks/Python/Python3.framework/Versions/Current/bin/python3"
rm="/bin/rm"
# Change to this project's directory
project_folder=$(${dirname} "$0")
cd "${project_folder}"
# Determine variables to make this script more generic
pkg_name="$(${basename} ${PWD})"
pkg_version="$(${PlistBuddy} -c 'print version' ./build-info.plist)"
# Delete stray .DS_Store file in /payload
# This fixes the error: The operation couldnÕt be completed. Can't find "." in bom file
if [[ -e ./payload/.DS_Store ]]; then
${rm} ./payload/.DS_Store
fi
# Build the pkg
# Normally, we'd run `${python3} ${munkipkg} .` but instead we're exporting Bom info to Bom.txt for Git tracking of permissions
# If building this package after running `git clone`, be sure to run `${python3} ${munkipkg} --sync .` first
${python3} ${munkipkg} --export-bom-info .
exit