Skip to content

Commit

Permalink
don't suppress protontricks error messages when getting prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
rockerbacon committed May 4, 2024
1 parent d86fe7a commit a38c703
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion step/clean_game_prefix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 15 additions & 5 deletions utils/protontricks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit a38c703

Please sign in to comment.