1
0
Fork 0
mirror of synced 2024-06-29 11:31:06 +12:00

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 8d26d90456
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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