2018-12-02 07:26:45 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-10-12 03:22:59 +08:00
|
|
|
SRC_DIR=./dist/trilium-windows-x64-src
|
|
|
|
|
|
|
|
if [ "$1" != "DONTCOPY" ]
|
|
|
|
then
|
|
|
|
./bin/copy-trilium.sh $SRC_DIR
|
|
|
|
fi
|
2018-12-02 07:26:45 +08:00
|
|
|
|
2019-01-13 02:48:45 +08:00
|
|
|
echo "Copying required windows binaries"
|
2018-12-02 07:26:45 +08:00
|
|
|
|
2019-10-12 03:22:59 +08:00
|
|
|
rm -r $SRC_DIR/node_modules/sqlite3/lib/binding/*
|
|
|
|
rm -r $SRC_DIR/node_modules/mozjpeg/vendor/*
|
|
|
|
rm -r $SRC_DIR/node_modules/pngquant-bin/vendor/*
|
|
|
|
rm -r $SRC_DIR/node_modules/giflossy/vendor/*
|
|
|
|
rm -r $SRC_DIR/node_modules/@felixrieseberg/spellchecker/build/Release/*
|
|
|
|
rm -r $SRC_DIR/node_modules/keyboard-layout/build/Release/*
|
2019-10-25 05:02:29 +08:00
|
|
|
rm -r $SRC_DIR/node_modules/cld/build/Release/*
|
2018-12-02 07:26:45 +08:00
|
|
|
|
2019-10-12 03:22:59 +08:00
|
|
|
cp -r bin/deps/win-x64/sqlite/* $SRC_DIR/node_modules/sqlite3/lib/binding/
|
|
|
|
cp bin/deps/win-x64/image/cjpeg.exe $SRC_DIR/node_modules/mozjpeg/vendor/
|
|
|
|
cp bin/deps/win-x64/image/pngquant.exe $SRC_DIR/node_modules/pngquant-bin/vendor/
|
|
|
|
cp bin/deps/win-x64/image/gifsicle.exe $SRC_DIR/node_modules/giflossy/vendor/
|
|
|
|
cp bin/deps/win-x64/spellchecker/* $SRC_DIR/node_modules/@felixrieseberg/spellchecker/build/Release/
|
|
|
|
cp bin/deps/win-x64/keyboard-layout-manager.node $SRC_DIR/node_modules/keyboard-layout/build/Release/
|
2018-12-02 07:26:45 +08:00
|
|
|
|
2019-10-12 03:22:59 +08:00
|
|
|
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=win32 --arch=x64 --overwrite --icon=images/app-icons/win/icon.ico
|
|
|
|
|
|
|
|
BUILD_DIR=./dist/trilium-windows-x64
|
|
|
|
rm -rf $BUILD_DIR
|
2018-12-02 07:26:45 +08:00
|
|
|
|
2019-01-13 02:48:45 +08:00
|
|
|
mv "./dist/Trilium Notes-win32-x64" $BUILD_DIR
|
2018-12-02 07:26:45 +08:00
|
|
|
|
|
|
|
# removing software WebGL binaries because they are pretty huge and not necessary
|
|
|
|
rm -r $BUILD_DIR/swiftshader
|
|
|
|
|
2019-01-13 02:48:45 +08:00
|
|
|
echo "Zipping windows 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
|
|
|
|
|
|
|
|
zip -r9 trilium-windows-x64-${VERSION}.zip trilium-windows-x64
|