-
Notifications
You must be signed in to change notification settings - Fork 130
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
1 parent
1d1104e
commit a3c8dc9
Showing
7 changed files
with
115 additions
and
11 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
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,28 @@ | ||
PACKAGE_NAME=$1 | ||
VERSION=$2 | ||
SOURCE_BINARY_PATH=$3 | ||
DESTINATION_BINARY_NAME=$4 | ||
DATA_FOLDER_NAME=$5 | ||
CONFIGURATION_FILE_NAME=$6 | ||
UNINSTALLER_FILE_NAME=$7 | ||
|
||
mkdir installer | ||
mkdir Scripts | ||
|
||
cp $SOURCE_BINARY_PATH installer/$DESTINATION_BINARY_NAME | ||
|
||
export DESTINATION_BINARY_NAME | ||
cp postinstall_local Scripts/postinstall | ||
sed -i '' "3s/.*/DESTINATION_BINARY_NAME=$DESTINATION_BINARY_NAME/" Scripts/postinstall | ||
sed -i '' "4s/.*/DATA_FOLDER_NAME=$DATA_FOLDER_NAME/" Scripts/postinstall | ||
sed -i '' "5s/.*/CONFIGURATION_FILE_NAME=$CONFIGURATION_FILE_NAME/" Scripts/postinstall | ||
chmod +x Scripts/postinstall | ||
|
||
export DATA_FOLDER_NAME CONFIGURATION_FILE_NAME UNINSTALLER_FILE_NAME | ||
cp cortex-uninstall.sh installer/$UNINSTALLER_FILE_NAME | ||
sed -i '' "2s/.*/DESTINATION_BINARY_NAME=$DESTINATION_BINARY_NAME/" installer/$UNINSTALLER_FILE_NAME | ||
sed -i '' "3s/.*/DATA_FOLDER_NAME=$DATA_FOLDER_NAME/" installer/$UNINSTALLER_FILE_NAME | ||
sed -i '' "4s/.*/CONFIGURATION_FILE_NAME=$CONFIGURATION_FILE_NAME/" installer/$UNINSTALLER_FILE_NAME | ||
sed -i '' "5s/.*/UNINSTALLER_FILE_NAME=$UNINSTALLER_FILE_NAME/" installer/$UNINSTALLER_FILE_NAME | ||
|
||
pkgbuild --identifier ai.cortexcpp.pkg --version $VERSION --scripts Scripts --install-location /usr/local/bin --root ./installer ${PACKAGE_NAME}.pkg |
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,17 @@ | ||
#!/usr/bin/env sh | ||
set -e | ||
DESTINATION_BINARY_NAME=cortex | ||
DATA_FOLDER_NAME=.cortex | ||
CONFIGURATION_FILE_NAME=.cortexrc | ||
|
||
USER_TO_RUN_AS=$(stat -f "%Su" /dev/console) | ||
|
||
echo "Download cortex.llamacpp engines by default for user $USER_TO_RUN_AS" | ||
sudo -u $USER_TO_RUN_AS /usr/local/bin/$DESTINATION_BINARY_NAME engines install cortex.llamacpp -s ./dependencies | ||
|
||
sudo chown -R $USER_TO_RUN_AS:staff "/Users/$USER_TO_RUN_AS/$DATA_FOLDER_NAME" | ||
sudo chown $USER_TO_RUN_AS:staff "/Users/$USER_TO_RUN_AS/$CONFIGURATION_FILE_NAME" | ||
|
||
rm -rf ./dependencies | ||
|
||
exit 0 |