From 0bdb06038cfd69bd478ca8077495cc30d9ef9399 Mon Sep 17 00:00:00 2001 From: Loudbook Date: Wed, 19 Jun 2024 20:02:34 -0400 Subject: [PATCH] Update MacOS Script --- scripts/logbook/logbook.sh | 92 +++++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 42 deletions(-) diff --git a/scripts/logbook/logbook.sh b/scripts/logbook/logbook.sh index 1630bfd..f55f0af 100644 --- a/scripts/logbook/logbook.sh +++ b/scripts/logbook/logbook.sh @@ -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" @@ -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 @@ -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"/*/) @@ -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 @@ -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