From 012a007116f3fc3c524a54b212c930d3dd33ff8b Mon Sep 17 00:00:00 2001 From: tomamplius Date: Fri, 21 Oct 2022 21:09:03 +0200 Subject: [PATCH] use egrep to replace grep + awk --- scripts/cleanup.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/cleanup.sh b/scripts/cleanup.sh index adfc3408dc..e13d7ff81c 100644 --- a/scripts/cleanup.sh +++ b/scripts/cleanup.sh @@ -1,4 +1,5 @@ #!/bin/bash -KEEP="dist package.json yarn.lock client builder build pm2.config.js docker_run.sh" -ls | grep -v $(echo ${KEEP} | awk '{split($0,a," ");for (i in a) printf "-e ^"a[i]"$ "}') | xargs rm -fr +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 -rf NODE_ENV=production yarn