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
|
2021-04-10 05:40:42 +08:00
|
|
|
NODE_VERSION=14.16.1
|
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*
|
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
|
|
|
|
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
|