2018-12-02 07:26:45 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
BUILD_DIR=./dist/trilium-mac-x64
|
|
|
|
rm -rf $BUILD_DIR
|
|
|
|
|
|
|
|
echo "Copying required mac binaries"
|
|
|
|
|
2019-01-13 02:48:45 +08:00
|
|
|
rm -r node_modules/sqlite3/lib/binding/*
|
|
|
|
rm -r node_modules/mozjpeg/vendor/*
|
|
|
|
rm -r node_modules/pngquant-bin/vendor/*
|
|
|
|
rm -r node_modules/giflossy/vendor/*
|
2018-12-02 07:26:45 +08:00
|
|
|
|
2019-01-13 02:48:45 +08:00
|
|
|
cp -r bin/deps/mac-x64/sqlite/* node_modules/sqlite3/lib/binding/
|
|
|
|
cp bin/deps/mac-x64/image/cjpeg node_modules/mozjpeg/vendor/
|
|
|
|
cp bin/deps/mac-x64/image/pngquant node_modules/pngquant-bin/vendor/
|
|
|
|
cp bin/deps/mac-x64/image/gifsicle node_modules/giflossy/vendor/
|
2018-12-02 07:26:45 +08:00
|
|
|
|
2019-03-30 16:39:58 +08:00
|
|
|
./node_modules/.bin/electron-packager . --asar --out=dist --executable-name=trilium --platform=darwin --arch=x64 --overwrite --icon=images/app-icons/mac/icon.icns
|
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
|
|
|
|
|
2019-02-18 05:56:33 +08:00
|
|
|
./bin/reset-local.sh
|
2018-12-02 07:26:45 +08:00
|
|
|
|
2019-01-13 02:48:45 +08:00
|
|
|
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
|