Skip to content

Commit 5872c76

Browse files
authored
fixes issues with moving out existing resource packs to backup folder (#362)
1 parent db8546e commit 5872c76

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

bedrock-entry.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,16 @@ if [ ! -f "bedrock_server-${VERSION}" ]; then
129129
bkupDir=backup-pre-${VERSION}
130130
# fixup any previous interrupted upgrades
131131
rm -rf "${bkupDir}"
132-
for d in behavior_packs definitions minecraftpe resource_packs structures treatments world_templates
133-
do
134-
if [ -d $d ]; then
135-
mkdir -p $bkupDir
132+
for d in behavior_packs definitions minecraftpe resource_packs structures treatments world_templates; do
133+
if [[ -d $d && -n "$(ls $d)" ]]; then
134+
mkdir -p $bkupDir/$d
136135
echo "Backing up $d into $bkupDir"
137-
mv $d $bkupDir
136+
if [[ "$d" == "resource_packs" ]]; then
137+
mv $d/{chemistry,vanilla} $bkupDir/
138+
[[ -n "$(ls $d)" ]] && cp -a $d/* $bkupDir/
139+
else
140+
mv $d/* $bkupDir/
141+
fi
138142
fi
139143
done
140144

0 commit comments

Comments
 (0)