From f69a86baf5f916b21651dfd4c7c332f6cafb91f2 Mon Sep 17 00:00:00 2001 From: timoxa0 Date: Mon, 12 Aug 2024 17:36:10 +0500 Subject: [PATCH] common.sh: Ensure that ./cache exists --- common.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common.sh b/common.sh index a5c16f1..84fedc0 100755 --- a/common.sh +++ b/common.sh @@ -17,6 +17,10 @@ function sigterm_handler() { trap 'trap " " SIGINT SIGTERM SIGHUP; kill 0; wait; sigterm_handler' SIGINT SIGTERM SIGHUP +[ -d ./cache/ ] || { + [ -f ./cache ] || rm ./cache + mkdir ./cache/ +} function create_image() { name="$(realpath "./raw/${1}.img")"