Skip to content

Commit 882c83f

Browse files
committed
updated to generate and pkg man page
1 parent 092dc4a commit 882c83f

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

pkgAndNotarize.sh

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ binary_names=( "utiluti" )
3737
pkg_name="$product_name"
3838
identifier="com.scriptingosx.${product_name}"
3939
min_os_version="11.5"
40-
install_location="/usr/local/bin/"
40+
install_location="/"
4141

4242

4343
# don't modify below here
@@ -66,7 +66,6 @@ if [[ ! -d $build_dir ]]; then
6666
exit 3
6767
fi
6868

69-
7069
binary_source_path="${build_dir}/apple/Products/Release/${binary_names[1]}"
7170

7271
if [[ ! -e $binary_source_path ]]; then
@@ -82,10 +81,26 @@ if [[ $version == "" ]]; then
8281
exit 5
8382
fi
8483

84+
# generate man page
85+
if ! swift package plugin generate-manual; then
86+
echo "error generating man page"
87+
exit 11
88+
fi
89+
90+
manpage_source_path="${build_dir}/plugins/GenerateManual/outputs/${binary_names[1]}/${binary_names[1]}.1"
91+
92+
if [[ ! -e $manpage_source_path ]]; then
93+
echo "cannot find manpage at $manpage_source_path"
94+
exit 11
95+
fi
96+
8597
component_path="${build_dir}/${pkg_name}.pkg"
8698
product_path="${build_dir}/${pkg_name}-${version}.pkg"
8799
pkgroot="${build_dir}/pkgroot"
88100

101+
binary_location="${pkgroot}/usr/local/bin/"
102+
manpage_location="${pkgroot}/usr/local/share/man/man1/"
103+
89104
echo
90105
echo "### Signing, Packaging and Notarizing '$product_name'"
91106
echo "Version: $version"
@@ -98,18 +113,22 @@ if [[ ! -d $pkgroot ]]; then
98113
mkdir -p $pkgroot
99114
fi
100115

116+
mkdir -p $binary_location
117+
mkdir -p $manpage_location
118+
119+
# copy and sign the binaries
120+
101121
for binary in ${binary_names}; do
102122
binary_source_path="${build_dir}/apple/Products/Release/${binary}"
103123

104124
if [[ ! -f $binary_source_path ]]; then
105-
echo "can't find binary at $binary_path"
125+
echo "can't find binary at $binary_source_path"
106126
exit 6
107127
fi
108128

109-
cp $binary_source_path $pkgroot
110-
#scripts_dir="$SRCROOT/scripts"
129+
cp $binary_source_path $binary_location
111130

112-
binary_path=$pkgroot/$binary
131+
binary_path=${binary_location}/${binary}
113132

114133
# sign the binary
115134
echo
@@ -126,6 +145,11 @@ for binary in ${binary_names}; do
126145

127146
done
128147

148+
# copy the manpage
149+
echo
150+
echo "copying man page"
151+
cp $manpage_source_path $manpage_location
152+
129153
# create the component pkg
130154
echo
131155
echo "### building component pkg file"

0 commit comments

Comments
 (0)