2018-12-02 07:26:45 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-10-12 03:22:59 +08:00
|
|
|
SRC_DIR=./dist/trilium-mac-x64-src
|
|
|
|
|
|
|
|
if [ "$1" != "DONTCOPY" ]
|
|
|
|
then
|
|
|
|
./bin/copy-trilium.sh $SRC_DIR
|
|
|
|
fi
|
2018-12-02 07:26:45 +08:00
|
|
|
|
|
|
|
echo "Copying required mac binaries"
|
|
|
|
|
2020-08-25 02:26:52 +08:00
|
|
|
cp -r bin/better-sqlite3/mac-better_sqlite3.node $SRC_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
2018-12-02 07:26:45 +08:00
|
|
|
|
2020-04-16 03:49:36 +08:00
|
|
|
rm -r $SRC_DIR/src/public/app-dist/*.mobile.*
|
2020-04-12 20:22:51 +08:00
|
|
|
|
2020-09-16 23:34:48 +08:00
|
|
|
echo "Packaging mac x64 electron build"
|
|
|
|
|
2019-10-12 03:22:59 +08:00
|
|
|
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=darwin --arch=x64 --overwrite --icon=images/app-icons/mac/icon.icns
|
|
|
|
|
|
|
|
BUILD_DIR=./dist/trilium-mac-x64
|
|
|
|
rm -rf $BUILD_DIR
|
2018-12-02 07:26:45 +08:00
|
|
|
|
2019-01-13 02:48:45 +08:00
|
|
|
# Mac build has by default useless directory level
|
|
|
|
mv "./dist/Trilium Notes-darwin-x64" $BUILD_DIR
|
|
|
|
|
|
|
|
echo "Zipping mac x64 electron distribution..."
|
2018-12-02 07:26:45 +08:00
|
|
|
|
|
|
|
VERSION=`jq -r ".version" package.json`
|
2019-01-13 02:48:45 +08:00
|
|
|
|
|
|
|
cd dist
|
|
|
|
|
|
|
|
rm trilium-mac-x64-${VERSION}.zip
|
|
|
|
zip -r9 --symlinks trilium-mac-x64-${VERSION}.zip trilium-mac-x64
|