From: Torsten Bögershausen Date: Mon, 24 Apr 2017 09:39:26 GMT Subject: Re: [PATCH] test-lib: abort when can't remove trash directory Message-ID: <18ee407c-db3b-16a2-4822-0ff302045b27@web.de> In-Reply-To: <20170424075241.ybbq2cpvbmwtdwz7@sigill.intra.peff.net> [] >> >> - cd "$(dirname "$remove_trash")" && >> - rm -rf "$(basename "$remove_trash")" || >> - error "Tests passed but test cleanup failed; aborting" >> + cd "$(dirname "$TRASH_DIRECTORY")" && >> + rm -fr "$TRASH_DIRECTORY" || >> + error "Tests passed but test cleanup failed; aborting" >> + fi > > Yeah, that looks good to me. Does it ? Checking the error code of "rm -f" doesn't work as expected from the script: rm -rf DoesNotExist ; echo $? 0 I think it should be >> + cd "$(dirname "$TRASH_DIRECTORY")" && >> + rm -r "$TRASH_DIRECTORY" || >> + error "Tests passed but test cleanup failed; aborting"