Improve backup process of Mojang resource packs during upgrade (#507)

This commit is contained in:
Geoff Bourne authored and GitHub committed 2025-04-14 12:29:27 -05:00
1 parent e0a76ec083
commit e17c2ecc62
1 file changed
+10 -2
+10 -2
View File
@@ -125,8 +125,16 @@ 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}/$d/"
cp -a $d/ "${bkupDir}/$d/"
# Copy over resource packs to ensure user-supplied ones remain
cp -a $d/* "${bkupDir}/$d/"
# ...however, need to fully remove Mojang provided resource packs to ensure consistent content
for rp_dir in chemistry vanilla editor; do
if [[ -d "$d/$rp_dir" ]]; then
# shellcheck disable=SC2115
rm -rf "$d/$rp_dir"
fi
done
else
mv $d "${bkupDir}/"
fi