#!/bin/bash

# Replace this variable with your Saved folder directory.
APPDATA_DIR="...AppData/Local/WonderfulWizard/Saved"

# Check if the backup folder exists.
if [ ! -d "$APPDATA_DIR/HiddenSaveGames/SaveGames" ]; then
  echo "There was not a backed up save located in the hidden folder."
  exit 1
fi

# Remove the existing savegames folder if there is one.
if [ -d "$APPDATA_DIR/SaveGames" ]; then
  rm -rf "$APPDATA_DIR/SaveGames"
fi

# Move the hidden saves back into the standard folder.
mv "$APPDATA_DIR/HiddenSaveGames/SaveGames" "$APPDATA_DIR/SaveGames" || { echo "Failed to move the folder."; exit 1; }

echo "Successfully restored save game."

