Notes/bin/copy-trilium.sh

27 lines
810 B
Bash
Raw Normal View History

2019-10-11 21:22:59 +02:00
#!/usr/bin/env bash
set -e # Fail on any command error
shopt -s globstar
BUILD_DIR="./build"
if ! [[ $(which npm) ]]; then
echo "Missing npm"
exit 1
fi
2019-10-11 21:22:59 +02:00
if [[ -d "$BUILD_DIR"/node_modules ]]; then
2024-07-20 20:31:36 +03:00
# cleanup of useless files in dependencies
2024-07-20 20:39:18 +03:00
for d in 'image-q/demo' \
'@excalidraw/excalidraw/dist/excalidraw-assets-dev' '@excalidraw/excalidraw/dist/excalidraw.development.js' '@excalidraw/excalidraw/dist/excalidraw-with-preact.development.js' \
2024-07-20 20:39:18 +03:00
'mermaid/dist/mermaid.js' \
'boxicons/svg' 'boxicons/node_modules/react'/* \
2024-07-20 20:39:18 +03:00
'@jimp/plugin-print/fonts' 'jimp/browser' 'jimp/fonts'; do
[[ -e "$BUILD_DIR"/node_modules/"$d" ]] && rm -r "$BUILD_DIR"/node_modules/"$d"
done
fi
find $BUILD_DIR/libraries -name "*.map" -type f -delete
2020-04-12 14:22:51 +02:00
unset f d BUILD_DIR