trilium/bin/build-server.sh

33 lines
793 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2019-10-16 02:32:43 +08:00
PKG_DIR=dist/trilium-linux-x64-server
NODE_VERSION=12.16.1
2019-10-12 03:22:59 +08:00
if [ "$1" != "DONTCOPY" ]
then
./bin/copy-trilium.sh $PKG_DIR
fi
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
tar xvfJ node-v${NODE_VERSION}-linux-x64.tar.xz
rm node-v${NODE_VERSION}-linux-x64.tar.xz
2019-10-12 03:22:59 +08:00
cd ..
2019-10-12 03:22:59 +08:00
mv dist/node-v${NODE_VERSION}-linux-x64 $PKG_DIR/node
2019-10-12 03:22:59 +08:00
rm -r $PKG_DIR/node_modules/electron*
2019-10-12 03:22:59 +08:00
rm -r $PKG_DIR/node_modules/sqlite3/lib/binding/*
2019-10-12 03:22:59 +08:00
cp -r ./bin/deps/linux-x64/sqlite/node* $PKG_DIR/node_modules/sqlite3/lib/binding/
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
2019-10-12 03:22:59 +08:00
VERSION=`jq -r ".version" package.json`
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