Merge pull request #8180 from tomamplius/clean_script

Single Image build clean up: replace move with rm
This commit is contained in:
Jonny McCullagh 2022-10-21 20:33:28 +01:00 committed by GitHub
commit f559d5d953
1 changed files with 3 additions and 14 deletions

View File

@ -1,16 +1,5 @@
#!/bin/bash
dir=$(pwd)
declare -a keep=("dist" "package.json" "yarn.lock" "client" "builder" "build" "pm2.config.js" "docker_run.sh")
for moveDir in "${keep[@]}"
do
mv $moveDir / 2>/dev/null
done
cd /
rm -r $dir
mkdir $dir
for keepDir in "${keep[@]}"
do
mv /$keepDir $dir/ 2>/dev/null
done
cd $dir
KEEP="dist|package.json|yarn.lock|client|builder|build|pm2.config.js|docker_run.sh"
echo "Removing unneeded build files:"
ls | egrep -v $KEEP | xargs rm -rfv
NODE_ENV=production yarn