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 #!/bin/bash
dir=$(pwd) KEEP="dist|package.json|yarn.lock|client|builder|build|pm2.config.js|docker_run.sh"
declare -a keep=("dist" "package.json" "yarn.lock" "client" "builder" "build" "pm2.config.js" "docker_run.sh") echo "Removing unneeded build files:"
for moveDir in "${keep[@]}" ls | egrep -v $KEEP | xargs rm -rfv
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
NODE_ENV=production yarn NODE_ENV=production yarn