Skip to content

Commit

Permalink
fixes issues with moving out existing resource packs to backup folder (
Browse files Browse the repository at this point in the history
  • Loading branch information
bb-Ricardo authored Oct 25, 2023
1 parent db8546e commit 5872c76
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions bedrock-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,16 @@ if [ ! -f "bedrock_server-${VERSION}" ]; then
bkupDir=backup-pre-${VERSION}
# fixup any previous interrupted upgrades
rm -rf "${bkupDir}"
for d in behavior_packs definitions minecraftpe resource_packs structures treatments world_templates
do
if [ -d $d ]; then
mkdir -p $bkupDir
for d in behavior_packs definitions minecraftpe resource_packs structures treatments world_templates; do
if [[ -d $d && -n "$(ls $d)" ]]; then
mkdir -p $bkupDir/$d
echo "Backing up $d into $bkupDir"
mv $d $bkupDir
if [[ "$d" == "resource_packs" ]]; then
mv $d/{chemistry,vanilla} $bkupDir/
[[ -n "$(ls $d)" ]] && cp -a $d/* $bkupDir/
else
mv $d/* $bkupDir/
fi
fi
done

Expand Down

0 comments on commit 5872c76

Please sign in to comment.