From a38c7035fc7323c15d73b4b51a9d80c9d33e7b07 Mon Sep 17 00:00:00 2001 From: rockerbacon Date: Sat, 4 May 2024 08:11:44 -0300 Subject: [PATCH] don't suppress protontricks error messages when getting prefix --- step/clean_game_prefix.sh | 2 +- utils/protontricks.sh | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/step/clean_game_prefix.sh b/step/clean_game_prefix.sh index cd67b46..58d9379 100644 --- a/step/clean_game_prefix.sh +++ b/step/clean_game_prefix.sh @@ -85,7 +85,7 @@ if [ -z "$game_prefix" ]; then log_error "no prefix found" "$dialog" \ errorbox \ - "A prefix for the selected game could not be found.\nMake sure you have followed the instructions\non creating a clean prefix" + "A prefix for the selected game could not be found.\nMake sure you have followed the instructions on creating a clean prefix.\nCheck the terminal output for more details." exit 1 fi diff --git a/utils/protontricks.sh b/utils/protontricks.sh index bd2f296..23613c0 100755 --- a/utils/protontricks.sh +++ b/utils/protontricks.sh @@ -47,12 +47,22 @@ function apply() { } function get_prefix() { - prefix=$( \ - do_protontricks -c 'echo $WINEPREFIX' "$1" 2>/dev/null || \ - true \ + local visible=$(do_protontricks -l | grep -o "$1") + if [ -z "$visible" ]; then + return 0 + fi + + local stdout=$( \ + do_protontricks -c 'echo $WINEPREFIX' "$1" || true \ ) - if [ -d "$prefix" ]; then - echo "$prefix" + + if [ -d "$stdout" ]; then + echo "$stdout" + else + log_error \ + "Protontricks did not find a valid prefix directory. " \ + "Stdout was:\n$stdout" + return 1 fi }