1
0
Fork 0
mirror of https://github.com/xHyroM/aetheria.git synced 2024-12-22 12:31:06 +01:00
aetheria/slugs-to-packwiz.sh

44 lines
793 B
Bash
Raw Normal View History

2024-06-14 19:06:44 +02:00
#!/bin/bash
# This script is used to convert slugs.txt to packwiz format
SLUGS_FILE=$1
PACKWIZ_MODPACK_FOLDER=$2
if [ -z "$SLUGS_FILE" ]; then
echo "Please provide a slugs file"
exit 1
fi
if [ -z "$PACKWIZ_MODPACK_FOLDER" ]; then
echo "Please provide a packwiz modpack folder"
exit 1
fi
if [ ! -f "$SLUGS_FILE" ]; then
echo "Slugs file not found"
exit 1
fi
if [ ! -d "$PACKWIZ_MODPACK_FOLDER" ]; then
echo "Packwiz modpack folder not found"
exit 1
fi
SLUGS=$(<"$SLUGS_FILE")
echo "Moving to $PACKWIZ_MODPACK_FOLDER"
cd "$PACKWIZ_MODPACK_FOLDER"
length=$(echo "$SLUGS" | wc -l)
2024-06-15 23:38:45 +02:00
i=1
2024-06-14 19:06:44 +02:00
for slug in $SLUGS; do
echo "Processing $slug ($i / $length)"
output=$(echo "y" | packwiz modrinth add $slug)
echo "$output"
i=$((i+1))
echo ""
done