From 7f74b2e83f43ffeee7099e47af256c0929f4a33b Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Tue, 24 Jan 2023 00:35:12 +0100 Subject: [PATCH] armbian-next: `docker`: don't spew errors about sharing cache if cache doesn't even exist --- lib/functions/host/docker.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/functions/host/docker.sh b/lib/functions/host/docker.sh index 58d8f5daf9..757ed21011 100755 --- a/lib/functions/host/docker.sh +++ b/lib/functions/host/docker.sh @@ -260,8 +260,8 @@ function docker_cli_build_dockerfile() { declare docker_marker_dir="${SRC}"/cache/docker - # If we can't write to cache dir... - if [[ ! -w "${SRC}"/cache ]]; then + # If cache dir exists, but we can't write to cache dir... + if [[ -d "${SRC}"/cache ]] && [[ ! -w "${SRC}"/cache ]]; then display_alert "Cannot write to cache/docker" "probably trying to share a cache with 'sudo' version" "err" display_alert "Sharing a cache directory between sudo and Docker is not tested." "Proceed at your own risk" "warn" countdown_and_continue_if_not_aborted 10