From 6b14f85502f53aaee3cf1f7fba4cd6fc09bf9b3b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 30 Dec 2016 17:52:28 +0100 Subject: [PATCH] Only sudo rm if necessary --- id-deb-build/docker-build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/id-deb-build/docker-build.sh b/id-deb-build/docker-build.sh index e608f79..ce331a6 100755 --- a/id-deb-build/docker-build.sh +++ b/id-deb-build/docker-build.sh @@ -141,7 +141,7 @@ fi if $centos; then for dist in ${CENTOS_DIST}; do - sudo rm -fr build/centos/$dist + test -d build/centos/$dist && sudo rm -fr build/centos/$dist mkdir -p build/centos/$dist/rpmbuild mkdir -p build/centos/$dist/rpmbuild/BUILD mkdir -p build/centos/$dist/rpmbuild/BUILDROOT @@ -186,7 +186,7 @@ if $debian; then if test "${DEBIAN_DIST}"; then for dist in ${DEBIAN_DIST}; do - sudo rm -fr build/debian/$dist + test -f build/debian/$dist && sudo rm -fr build/debian/$dist mkdir -p build/debian cp -a deb-src build/debian/$dist cp ${ID_DEB_BUILD}/in-docker.sh build/debian/$dist -- 1.7.10.4