mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
Reduce warnings count caused by bin/copy-trilium.sh
This commit is contained in:
parent
1f95e88cfd
commit
ff5d5d20d9
@ -7,44 +7,42 @@ fi
|
|||||||
|
|
||||||
n exec 18.18.2 npm run webpack
|
n exec 18.18.2 npm run webpack
|
||||||
|
|
||||||
DIR=$1
|
DIR="$1"
|
||||||
|
|
||||||
rm -rf $DIR
|
rm -rf "$DIR"
|
||||||
mkdir $DIR
|
mkdir -v "$DIR"
|
||||||
|
|
||||||
echo "Copying Trilium to build directory $DIR"
|
echo "Copying Trilium to build directory $DIR"
|
||||||
|
|
||||||
cp -r images $DIR/
|
for d in 'images' 'libraries' 'src' 'db'; do
|
||||||
cp -r libraries $DIR/
|
cp -r "$d" "$DIR"/
|
||||||
cp -r src $DIR/
|
done
|
||||||
cp -r db $DIR/
|
for f in 'package.json' 'package-lock.json' 'README.md' 'LICENSE' 'config-sample.ini' 'electron.js'; do
|
||||||
cp -r package.json $DIR/
|
cp "$f" "$DIR"/
|
||||||
cp -r package-lock.json $DIR/
|
done
|
||||||
cp -r README.md $DIR/
|
cp webpack-* "$DIR"/ # here warning because there is no 'webpack-*', but webpack.config.js only
|
||||||
cp -r LICENSE $DIR/
|
|
||||||
cp -r config-sample.ini $DIR/
|
|
||||||
cp -r electron.js $DIR/
|
|
||||||
cp webpack-* $DIR/
|
|
||||||
|
|
||||||
# run in subshell (so we return to original dir)
|
# run in subshell (so we return to original dir)
|
||||||
(cd $DIR && n exec 18.18.2 npm install --only=prod)
|
(cd $DIR && n exec 18.18.2 npm install --only=prod)
|
||||||
|
|
||||||
|
if [[ -d "$DIR"/node_modules ]]; then
|
||||||
# cleanup of useless files in dependencies
|
# cleanup of useless files in dependencies
|
||||||
rm -r $DIR/node_modules/image-q/demo
|
for d in 'image-q/demo' 'better-sqlite3/Release' 'better-sqlite3/deps/sqlite3.tar.gz' '@jimp/plugin-print/fonts' 'jimp/browser' 'jimp/fonts'; do
|
||||||
rm -r $DIR/node_modules/better-sqlite3/Release
|
[[ -e "$DIR"/node_modules/"$d" ]] && rm -rv "$DIR"/node_modules/"$d"
|
||||||
rm -r $DIR/node_modules/better-sqlite3/deps/sqlite3.tar.gz
|
done
|
||||||
rm -r $DIR/node_modules/@jimp/plugin-print/fonts
|
|
||||||
rm -r $DIR/node_modules/jimp/browser
|
|
||||||
rm -r $DIR/node_modules/jimp/fonts
|
|
||||||
|
|
||||||
# delete all tests (there are often large images as test file for jimp etc.)
|
# delete all tests (there are often large images as test file for jimp etc.)
|
||||||
find $DIR/node_modules -name test -exec rm -rf {} \;
|
for d in 'test' 'docs' 'demo'; do
|
||||||
find $DIR/node_modules -name docs -exec rm -rf {} \;
|
find "$DIR"/node_modules -name "$d" -exec rm -rf {} \;
|
||||||
find $DIR/node_modules -name demo -exec rm -rf {} \;
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
find $DIR/libraries -name "*.map" -type f -delete
|
find $DIR/libraries -name "*.map" -type f -delete
|
||||||
|
|
||||||
cp $DIR/src/public/app/share.js $DIR/src/public/app-dist/
|
d="$DIR"/src/public
|
||||||
cp -r $DIR/src/public/app/doc_notes $DIR/src/public/app-dist/
|
[[ -d "$d"/app-dist ]] || mkdir -pv "$d"/app-dist
|
||||||
|
cp -v "$d"/app/share.js "$d"/app-dist/
|
||||||
|
cp -rv "$d"/app/doc_notes "$d"/app-dist/
|
||||||
|
|
||||||
rm -rf $DIR/src/public/app
|
rm -rf "$d"/app
|
||||||
|
unset f d DIR
|
||||||
|
Loading…
x
Reference in New Issue
Block a user