2018-08-31 03:57:14 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-10-16 02:32:43 +08:00
|
|
|
PKG_DIR=dist/trilium-linux-x64-server
|
2023-10-18 15:40:00 +08:00
|
|
|
NODE_VERSION=18.18.2
|
2018-08-31 03:57:14 +08:00
|
|
|
|
2019-10-12 03:22:59 +08:00
|
|
|
if [ "$1" != "DONTCOPY" ]
|
|
|
|
then
|
|
|
|
./bin/copy-trilium.sh $PKG_DIR
|
|
|
|
fi
|
2018-08-31 03:57:14 +08:00
|
|
|
|
2019-10-12 03:22:59 +08:00
|
|
|
cd dist
|
2018-09-09 23:53:55 +08:00
|
|
|
wget https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz
|
2021-04-20 02:56:05 +08:00
|
|
|
tar xfJ node-v${NODE_VERSION}-linux-x64.tar.xz
|
2018-08-31 03:57:14 +08:00
|
|
|
rm node-v${NODE_VERSION}-linux-x64.tar.xz
|
2019-10-12 03:22:59 +08:00
|
|
|
cd ..
|
2018-08-31 03:57:14 +08:00
|
|
|
|
2019-10-12 03:22:59 +08:00
|
|
|
mv dist/node-v${NODE_VERSION}-linux-x64 $PKG_DIR/node
|
2018-08-31 03:57:14 +08:00
|
|
|
|
2020-08-27 05:51:30 +08:00
|
|
|
rm -r $PKG_DIR/node/lib/node_modules/npm
|
2020-08-28 05:04:00 +08:00
|
|
|
rm -r $PKG_DIR/node/include/node
|
2020-08-27 05:51:30 +08:00
|
|
|
|
2019-10-12 03:22:59 +08:00
|
|
|
rm -r $PKG_DIR/node_modules/electron*
|
2022-01-18 06:47:26 +08:00
|
|
|
rm -r $PKG_DIR/webpack*
|
|
|
|
rm -r $PKG_DIR/electron.js
|
2018-08-31 03:57:14 +08:00
|
|
|
|
2020-08-27 05:51:30 +08:00
|
|
|
cp -r bin/better-sqlite3/linux-server-better_sqlite3.node $PKG_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
2018-12-09 18:41:32 +08:00
|
|
|
|
2019-10-12 03:22:59 +08:00
|
|
|
printf "#!/bin/sh\n./node/bin/node src/www" > $PKG_DIR/trilium.sh
|
|
|
|
chmod 755 $PKG_DIR/trilium.sh
|
2018-08-31 03:57:14 +08:00
|
|
|
|
2022-01-18 06:47:26 +08:00
|
|
|
cp bin/tpl/anonymize-database.sql $PKG_DIR/
|
|
|
|
|
2022-02-13 05:51:28 +08:00
|
|
|
cp -r dump-db $PKG_DIR/
|
2022-12-05 06:49:16 +08:00
|
|
|
rm -rf $PKG_DIR/dump-db/node_modules
|
2022-02-13 05:51:28 +08:00
|
|
|
|
2019-10-12 03:22:59 +08:00
|
|
|
VERSION=`jq -r ".version" package.json`
|
2018-08-31 03:57:14 +08:00
|
|
|
|
2019-10-12 03:22:59 +08:00
|
|
|
cd dist
|
2019-01-13 02:48:45 +08:00
|
|
|
|
2019-10-16 02:32:43 +08:00
|
|
|
tar cJf trilium-linux-x64-server-${VERSION}.tar.xz trilium-linux-x64-server
|