Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
bin: Adapt copy-trilium to TypeScript changes
Elian Doran5b30bae5b276
diff --git a/bin/copy-trilium.sh b/bin/copy-trilium.shindex 9fdfe0293f..8affb7be31 100755--- a/bin/copy-trilium.sh+++ b/bin/copy-trilium.sh@@ -1,5 +1,8 @@#!/usr/bin/env bash+shopt -s globstar+set -e+if [[ $# -eq 0 ]] ; thenecho "Missing argument of target directory"exit 1@@ -9,25 +12,36 @@ if ! [[ $(which npm) ]]; thenexit 1fi-n exec 18.18.2 npm run webpack || npm run webpack+# Trigger the TypeScript build+echo TypeScript build start+npx tsc+echo TypeScript build finished+# Copy the TypeScript artifactsDIR="$1"-rm -rf "$DIR"mkdir -pv "$DIR"+echo Webpack start+npm run webpack+echo Webpack finish+echo "Copying Trilium to build directory $DIR"for d in 'images' 'libraries' 'src' 'db'; docp -r "$d" "$DIR"/done-for f in 'package.json' 'package-lock.json' 'README.md' 'LICENSE' 'config-sample.ini' 'electron.js'; do++for f in 'package.json' 'package-lock.json' 'README.md' 'LICENSE' 'config-sample.ini'; docp "$f" "$DIR"/done-cp webpack-* "$DIR"/ # here warning because there is no 'webpack-*', but webpack.config.js only++script_dir=$(realpath $(dirname $0))+cp -Rv "$script_dir/../build/src" "$DIR"+cp "$script_dir/../build/electron.js" "$DIR"# run in subshell (so we return to original dir)-(cd $DIR && n exec 18.18.2 npm install --only=prod)+(cd $DIR && npm install --only=prod)if [[ -d "$DIR"/node_modules ]]; then# cleanup of useless files in dependencies