Skip to content

Commit

Permalink
Update MacOS Script
Browse files Browse the repository at this point in the history
  • Loading branch information
Loudbooks committed Jun 20, 2024
1 parent 10ad62c commit 0bdb060
Showing 1 changed file with 50 additions and 42 deletions.
92 changes: 50 additions & 42 deletions scripts/logbook/logbook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,33 @@ while [ -z "$discord_username" ]; do
read -p "Enter your Discord username: " discord_username
done

echo
echo "Confirm your log type:"
echo "1) Latest Log"
echo "2) Launcher Log"
read -p "Enter your choice: " log_type

if [ "$log_type" == "1" ]; then
log_name="latest"
elif [ "$log_type" == "2" ]; then
log_name="launcher"
else
echo
echo "Invalid log type. Please try again."
exec "$0"
fi

echo
echo "Confirm your launcher:"
echo "1) Official Launcher"
echo "2) Prism Launcher"
echo "3) Modrinth Launcher"
echo "4) Technic Launcher"
echo "2) CurseForge Launcher"
echo "3) Prism Launcher"
echo "4) Modrinth Launcher"
echo "5) Technic Launcher"
read -p "Enter your choice: " launcher_type

case $launcher_type in
1)
echo
echo "Confirm your log type:"
echo "1) Latest Log"
echo "2) Launcher Log"
read -p "Enter your choice: " log_type

if [ "$log_type" == "1" ]; then
log_name="latest"
elif [ "$log_type" == "2" ]; then
log_name="launcher"
else
echo
echo "Invalid log type. Please try again."
exec "$0"
fi

if [ "$log_name" == "latest" ]; then
selected_directory="$HOME/Library/Application Support/minecraft/logs/latest.log"
log_name="Latest Log"
Expand All @@ -42,6 +43,28 @@ case $launcher_type in
fi
;;
2)
index=1
prism_dirs=("$HOME/Documents/curseforge/minecraft/Instances"/*/)
if [ ${#prism_dirs[@]} -eq 0 ]; then
echo
echo "No CurseForge installations found."
exit 1
fi

echo
echo "Your CurseForge installations:"
for dir in "${prism_dirs[@]}"; do
echo "$index) $(basename "$dir")"
((index++))
done

read -p "Enter the index of the installation you are using: " selected_index
selected_dir=${prism_dirs[$selected_index-1]}

selected_directory=$selected_dir"logs/latest.log"
log_name="Prism Latest Log ($(basename "$selected_dir"))"
;;
3)
index=1
prism_dirs=("$HOME/Library/Application Support/PrismLauncher/instances"/*/)
if [ ${#prism_dirs[@]} -eq 0 ]; then
Expand All @@ -60,15 +83,10 @@ case $launcher_type in
read -p "Enter the index of the installation you are using: " selected_index
selected_dir=${prism_dirs[$selected_index-1]}

if [ "$log_type" == "launcher" ]; then
selected_directory="$selected_dir.minecraft/logs/launcher_log.txt"
log_name="Prism Launcher Log ($(basename "$selected_dir"))"
else
selected_directory="$selected_dir.minecraft/logs/latest.log"
log_name="Prism Latest Log ($(basename "$selected_dir"))"
fi
selected_directory="$selected_dir.minecraft/logs/latest.log"
log_name="Prism Latest Log ($(basename "$selected_dir"))"
;;
3)
4)
index=1
modrinth_dirs=("$HOME/Library/Application Support/com.modrinth.theseus/profiles"/*/)

Expand All @@ -88,15 +106,10 @@ case $launcher_type in
read -p "Enter the index of the installation you are using: " selected_index
selected_dir=${modrinth_dirs[$selected_index-1]}

if [ "$log_type" == "launcher" ]; then
selected_directory="$selected_dir/logs/launcher_log.txt"
log_name="Modrinth Launcher Log ($(basename "$selected_dir"))"
else
selected_directory="$selected_dir/logs/latest.log"
log_name="Modrinth Latest Log ($(basename "$selected_dir"))"
fi
selected_directory=$selected_dir"logs/latest.log"
log_name="Modrinth Latest Log ($(basename "$selected_dir"))"
;;
4)
5)
index=1
technic_dirs=("$HOME/Library/Application Support/technic/modpacks"/*/)
if [ ${#technic_dirs[@]} -eq 0 ]; then
Expand All @@ -115,13 +128,8 @@ case $launcher_type in
read -p "Enter the index of the installation you are using: " selected_index
selected_dir=${technic_dirs[$selected_index-1]}

if [ "$log_type" == "launcher" ]; then
selected_directory="$selected_dir/logs/launcher_log.txt"
log_name="Technic Launcher Log \($(basename "$selected_dir")\)"
else
selected_directory="$selected_dir/logs/latest.log"
log_name="Technic Latest Log \($(basename "$selected_dir")\)"
fi
selected_directory=$selected_dir"logs/latest.log"
log_name="Technic Latest Log \($(basename "$selected_dir")\)"
;;
*)
echo
Expand Down

0 comments on commit 0bdb060

Please sign in to comment.