From 73ecb78bc6c93872c73e0564712c28850b556e9b Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Thu, 27 Apr 2017 06:44:50 +0200 Subject: [PATCH] scripts: cleanup git tree only when one exists --- scripts/clean-build.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/clean-build.sh b/scripts/clean-build.sh index 0c0f612..d7219d7 100755 --- a/scripts/clean-build.sh +++ b/scripts/clean-build.sh @@ -44,8 +44,10 @@ cleanup() { # In cases where anbox comes directly from a checked out Android # build environment we miss some symlinks which are present on # the host and don't have a valid git repository in that case. - git clean -fdx . || true - git reset --hard || true + if [ -d .git ] ; then + git clean -fdx . + git reset --hard + fi } cleanup