Merge pull request #8180 from tomamplius/clean_script
Single Image build clean up: replace move with rm
This commit is contained in:
commit
f559d5d953
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue