Skip to content

Commit e17c2ec

Browse files
authored
Improve backup process of Mojang resource packs during upgrade (#507)
1 parent e0a76ec commit e17c2ec

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

bedrock-entry.sh

+10-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,16 @@ if [[ ! -f "bedrock_server-${VERSION}" ]]; then
125125
mkdir -p "${bkupDir}/$d"
126126
echo "Backing up $d into $bkupDir"
127127
if [[ "$d" == "resource_packs" ]]; then
128-
mv $d/{chemistry,vanilla} "${bkupDir}/$d/"
129-
cp -a $d/ "${bkupDir}/$d/"
128+
# Copy over resource packs to ensure user-supplied ones remain
129+
cp -a $d/* "${bkupDir}/$d/"
130+
131+
# ...however, need to fully remove Mojang provided resource packs to ensure consistent content
132+
for rp_dir in chemistry vanilla editor; do
133+
if [[ -d "$d/$rp_dir" ]]; then
134+
# shellcheck disable=SC2115
135+
rm -rf "$d/$rp_dir"
136+
fi
137+
done
130138
else
131139
mv $d "${bkupDir}/"
132140
fi

0 commit comments

Comments
 (0)