mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 05:28:59 +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
 | 
			
		||||
 | 
			
		||||
DIR=$1
 | 
			
		||||
DIR="$1"
 | 
			
		||||
 | 
			
		||||
rm -rf $DIR
 | 
			
		||||
mkdir $DIR
 | 
			
		||||
rm -rf "$DIR"
 | 
			
		||||
mkdir -v "$DIR"
 | 
			
		||||
 | 
			
		||||
echo "Copying Trilium to build directory $DIR"
 | 
			
		||||
 | 
			
		||||
cp -r images $DIR/
 | 
			
		||||
cp -r libraries $DIR/
 | 
			
		||||
cp -r src $DIR/
 | 
			
		||||
cp -r db $DIR/
 | 
			
		||||
cp -r package.json $DIR/
 | 
			
		||||
cp -r package-lock.json $DIR/
 | 
			
		||||
cp -r README.md $DIR/
 | 
			
		||||
cp -r LICENSE $DIR/
 | 
			
		||||
cp -r config-sample.ini $DIR/
 | 
			
		||||
cp -r electron.js $DIR/
 | 
			
		||||
cp webpack-* $DIR/
 | 
			
		||||
for d in 'images' 'libraries' 'src' 'db'; do
 | 
			
		||||
    cp -r "$d" "$DIR"/
 | 
			
		||||
done
 | 
			
		||||
for f in 'package.json' 'package-lock.json' 'README.md' 'LICENSE' 'config-sample.ini' 'electron.js'; do
 | 
			
		||||
    cp "$f" "$DIR"/
 | 
			
		||||
done
 | 
			
		||||
cp webpack-* "$DIR"/      # here warning because there is no 'webpack-*', but webpack.config.js only
 | 
			
		||||
 | 
			
		||||
# run in subshell (so we return to original dir)
 | 
			
		||||
(cd $DIR && n exec 18.18.2 npm install --only=prod)
 | 
			
		||||
 | 
			
		||||
if [[ -d "$DIR"/node_modules ]]; then
 | 
			
		||||
# cleanup of useless files in dependencies
 | 
			
		||||
rm -r $DIR/node_modules/image-q/demo
 | 
			
		||||
rm -r $DIR/node_modules/better-sqlite3/Release
 | 
			
		||||
rm -r $DIR/node_modules/better-sqlite3/deps/sqlite3.tar.gz
 | 
			
		||||
rm -r $DIR/node_modules/@jimp/plugin-print/fonts
 | 
			
		||||
rm -r $DIR/node_modules/jimp/browser
 | 
			
		||||
rm -r $DIR/node_modules/jimp/fonts
 | 
			
		||||
    for d in 'image-q/demo' 'better-sqlite3/Release' 'better-sqlite3/deps/sqlite3.tar.gz' '@jimp/plugin-print/fonts' 'jimp/browser' 'jimp/fonts'; do
 | 
			
		||||
        [[ -e "$DIR"/node_modules/"$d" ]] && rm -rv "$DIR"/node_modules/"$d"
 | 
			
		||||
    done
 | 
			
		||||
 | 
			
		||||
# delete all tests (there are often large images as test file for jimp etc.)
 | 
			
		||||
find $DIR/node_modules -name test -exec rm -rf {} \;
 | 
			
		||||
find $DIR/node_modules -name docs -exec rm -rf {} \;
 | 
			
		||||
find $DIR/node_modules -name demo -exec rm -rf {} \;
 | 
			
		||||
    for d in 'test' 'docs' 'demo'; do
 | 
			
		||||
        find "$DIR"/node_modules -name "$d" -exec rm -rf {} \;
 | 
			
		||||
    done
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
find $DIR/libraries -name "*.map" -type f -delete
 | 
			
		||||
 | 
			
		||||
cp $DIR/src/public/app/share.js $DIR/src/public/app-dist/
 | 
			
		||||
cp -r $DIR/src/public/app/doc_notes $DIR/src/public/app-dist/
 | 
			
		||||
d="$DIR"/src/public
 | 
			
		||||
[[ -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