From 60173a891be11ec4fc53e7dfca9b7dae9d688e18 Mon Sep 17 00:00:00 2001 From: Oliver Thorp <20244594+othorp@users.noreply.github.com> Date: Mon, 16 Sep 2024 00:45:29 +0100 Subject: [PATCH] Maintain directory structure on backup (#457) --- bedrock-entry.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bedrock-entry.sh b/bedrock-entry.sh index 46134bf..371dcb1 100755 --- a/bedrock-entry.sh +++ b/bedrock-entry.sh @@ -128,10 +128,10 @@ if [[ ! -f "bedrock_server-${VERSION}" ]]; then mkdir -p "${bkupDir}/$d" echo "Backing up $d into $bkupDir" if [[ "$d" == "resource_packs" ]]; then - mv $d/{chemistry,vanilla} "${bkupDir}/" - [[ -n "$(ls $d)" ]] && cp -a $d/* "${bkupDir}/" + mv $d/{chemistry,vanilla} "${bkupDir}/$d/" + cp -a $d/ "${bkupDir}/$d/" else - mv $d/* "${bkupDir}/" + mv $d "${bkupDir}/" fi fi done