-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
126 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/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 | ||
|