2018-12-02 07:26:45 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-10-12 03:22:59 +08:00
|
|
|
SRC_DIR=./dist/trilium-linux-x64-src
|
|
|
|
|
2024-03-02 14:18:39 +08:00
|
|
|
[ "$1" != "DONTCOPY" ] && ./bin/copy-trilium.sh "$SRC_DIR"
|
2018-12-02 07:26:45 +08:00
|
|
|
|
2024-03-02 14:18:39 +08:00
|
|
|
rm -r "$SRC_DIR"/src/public/app-dist/*.mobile.*
|
2020-04-12 20:22:51 +08:00
|
|
|
|
2020-08-23 05:07:31 +08:00
|
|
|
echo "Copying required linux-x64 binaries"
|
2024-03-02 14:18:39 +08:00
|
|
|
cp -r bin/better-sqlite3/linux-desktop-better_sqlite3.node "$SRC_DIR"/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
2019-01-13 02:48:45 +08:00
|
|
|
|
2020-09-16 23:34:48 +08:00
|
|
|
echo "Packaging linux x64 electron build"
|
2024-03-02 14:18:39 +08:00
|
|
|
./node_modules/.bin/electron-packager "$SRC_DIR" --asar --out=dist --executable-name=trilium --platform=linux --arch=x64 --overwrite
|
2018-12-02 07:26:45 +08:00
|
|
|
|
2019-10-12 03:22:59 +08:00
|
|
|
BUILD_DIR=./dist/trilium-linux-x64
|
2024-03-02 14:18:39 +08:00
|
|
|
rm -rf "$BUILD_DIR"
|
2019-01-23 02:49:33 +08:00
|
|
|
|
2024-03-02 14:18:39 +08:00
|
|
|
mv "./dist/Trilium Notes-linux-x64" "$BUILD_DIR"
|
2022-01-18 06:47:26 +08:00
|
|
|
|
2024-03-02 14:18:39 +08:00
|
|
|
cp images/app-icons/png/128x128.png "$BUILD_DIR"/icon.png
|
|
|
|
cp bin/tpl/anonymize-database.sql "$BUILD_DIR"/
|
2022-02-13 05:51:28 +08:00
|
|
|
|
2024-03-02 14:18:39 +08:00
|
|
|
cp -r dump-db "$BUILD_DIR"/
|
|
|
|
rm -rf "$BUILD_DIR"/dump-db/node_modules
|
2021-03-19 06:49:28 +08:00
|
|
|
|
2024-03-02 14:18:39 +08:00
|
|
|
for f in 'trilium-portable' 'trilium-safe-mode' 'trilium-no-cert-check'; do
|
|
|
|
cp bin/tpl/"$f".sh "$BUILD_DIR"/
|
|
|
|
chmod 755 "$BUILD_DIR"/"$f".sh
|
|
|
|
done
|
2020-04-30 03:55:57 +08:00
|
|
|
|
2018-12-02 07:26:45 +08:00
|
|
|
echo "Packaging linux x64 electron distribution..."
|
|
|
|
VERSION=`jq -r ".version" package.json`
|
2019-01-13 02:48:45 +08:00
|
|
|
|
2024-03-02 14:18:39 +08:00
|
|
|
pushd dist
|
|
|
|
tar cJf "trilium-linux-x64-${VERSION}.tar.xz" trilium-linux-x64
|
|
|
|
popd
|
2019-10-12 03:22:59 +08:00
|
|
|
|
2020-08-23 05:07:31 +08:00
|
|
|
bin/build-debian.sh
|