-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmk_misty
executable file
·42 lines (32 loc) · 1001 Bytes
/
mk_misty
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
31
32
33
34
35
36
37
38
39
40
41
#!/bin/zsh
#
# Clone the current repo state and create an installer pkg for misty
REPO_URL="https://github.com/wycomco/misty.git"
TMP_DIR="/var/tmp/misty_pkgbuild"
ORIGINAL_DIR=$(pwd)
if [ -d "$TMP_DIR" ]; then
echo "Found previously cloned repo in $TMP_DIR, deleting ..."
rm -rf "$TMP_DIR"
fi
git clone "$REPO_URL" "$TMP_DIR"
if [ $? -ne 0 ]; then
echo "Failed to clone repository."
exit 1
fi
cd "$TMP_DIR" || { echo "Failed to cd into $TMP_DIR"; exit 1; }
VERSION=$(git describe --tags --abbrev=0)
echo "Current version of misty is $VERSION"
echo "Replacing version in build-info.plist..."
sed -E -i '' "s/[0-9]+.[0-9]+.[0-9]+/${VERSION}/g" misty/build-info.plist
munkipkg misty
munkipkg_success="$?"
echo "Resetting version in build-info.plist..."
sed -E -i '' "s/${VERSION}/0.0.0/g" misty/build-info.plist
if [ "$munkipkg_success" -ne 0 ]; then
echo "munkipkg failed."
cd "$ORIGINAL_DIR" # Return to original directory
exit 1
fi
open misty/build
cd "$ORIGINAL_DIR"
exit 0