Last active
June 22, 2023 14:19
-
-
Save Niall47/7717793cb4501cd4625c7689bbd71bef to your computer and use it in GitHub Desktop.
MultiMC - Share schematics folder (linux)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Warning | |
# This assumes you already have copied your schematics to /share/schematics | |
# Also, we delete the original schematics folder in each instance, so back up everything you want to keep | |
multimc_instances_dir="$HOME/.local/share/multimc/instances" | |
shared_schematics_dir="$HOME/.local/share/schematics" | |
# Iterate over each instance folder | |
for instance_dir in "$multimc_instances_dir"/*/; do | |
instance_name=$(basename "$instance_dir") | |
schematics_dir="$instance_dir.minecraft/schematics" | |
# Check if schematics directory exists | |
if [[ -d "$schematics_dir" ]]; then | |
# Prompt for confirmation and replace schematics folder with symbolic link | |
read -p "Replace schematics folder with symbolic link for instance: $instance_name? (y/n): " choice | |
if [[ $choice == [Yy] ]]; then | |
# Remove existing schematics directory | |
rm -r "$schematics_dir" | |
# Create symbolic link to shared schematics folder | |
ln -s "$shared_schematics_dir" "$schematics_dir" | |
echo "Symbolic link created for instance: $instance_name" | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment