Correction for run.bat boots on windows and run.sh boots on linux.

This commit is contained in:
2024-12-07 14:45:18 +00:00
parent 5af6d9b987
commit fbe64cefe4
6 changed files with 78 additions and 9 deletions

View File

@@ -0,0 +1,10 @@
# What is this directory?
* In order to perform certain functions, spark sometimes needs to write temporary data to the disk.
* Previously, a temporary directory provided by the operating system was used for this purpose.
* However, this proved to be unreliable in some circumstances, so spark now stores temporary data here instead!
spark will automatically cleanup the contents of this directory.
(but if for some reason it doesn't, if the server is stopped, you can freely delete any files ending in .tmp)
tl;dr: spark uses this folder to store some temporary data.

File diff suppressed because one or more lines are too long

View File

@@ -1,8 +0,0 @@
python '/home/teddy/Documents/Programming/python/discord_bot_minecraft_bois/tests/test_message_server_start.py'
REM Forge requires a configured set of both JVM and program arguments.
REM Add custom JVM arguments to the user_jvm_args.txt
REM Add custom program arguments {such as nogui} to this file in the next line before the %* or
REM pass them to this script directly
java @user_jvm_args.txt @libraries/net/minecraftforge/forge/1.18.2-40.2.4/win_args.txt %*
python '/home/teddy/Documents/Programming/python/discord_bot_minecraft_bois/tests/test_message_server_stop.py'
pause

0
run.sh Normal file → Executable file
View File

View File

@@ -0,0 +1,67 @@
#!/bin/bash
# Configuration
REPO_URL="https://github.com/Teddy-1024/minecraft_server_zombie.git"
SYNC_FOLDERS="mods config kubejs defaultconfigs scripts resources patchouli_books pfm modernfix"
# Clear screen and show header
clear
echo "Minecraft Server Sync Tool"
echo "========================"
echo
# Check if git is installed
if ! command -v git &> /dev/null; then
echo "Git is not installed."
echo "Please install Git using your distribution's package manager"
echo "For example: sudo apt install git"
read -p "Press Enter to exit..."
exit 1
fi
# Create a temporary directory for the git operations
TEMP_GIT_DIR="/tmp/mc_git_sync"
rm -rf "$TEMP_GIT_DIR"
mkdir -p "$TEMP_GIT_DIR"
cd "$TEMP_GIT_DIR"
# Initialize git repo
git init
git remote add origin "$REPO_URL"
git config core.sparseCheckout true
# Set up sparse checkout for selected folders
rm -f .git/info/sparse-checkout
for folder in $SYNC_FOLDERS; do
echo "$folder/" >> .git/info/sparse-checkout
done
# Fetch latest content
git fetch --depth 1 origin main
git checkout main
# Copy contents to instance folders
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
for folder in $SYNC_FOLDERS; do
if [ -d "$TEMP_GIT_DIR/$folder" ]; then
echo "Syncing $folder..."
# Create target directory if it doesn't exist
mkdir -p "$SCRIPT_DIR/$folder"
# Copy contents, updating only newer files
rsync -u -r "$TEMP_GIT_DIR/$folder/" "$SCRIPT_DIR/$folder/"
fi
done
# Clean up
cd "$SCRIPT_DIR"
rm -rf "$TEMP_GIT_DIR"
echo
echo "Sync completed successfully!"
echo
echo "This sync has:"
echo "- Updated all tracked files from the repository"
echo "- Preserved your local untracked files"
echo
read -p "Press Enter to exit..."