Skip to content

Allow custom fail messages in patchscripts#322

Open
JeodC wants to merge 1 commit into
PortsMaster:mainfrom
JeodC:patcher-gui-failmsg
Open

Allow custom fail messages in patchscripts#322
JeodC wants to merge 1 commit into
PortsMaster:mainfrom
JeodC:patcher-gui-failmsg

Conversation

@JeodC
Copy link
Copy Markdown
Contributor

@JeodC JeodC commented May 12, 2026

The default is still "Patching failed! Please go to the PortMaster Discord for help." however with this addition, patchscripts can override with their own failure messages. This is more verbose for the end user and more helpful for the ecosystem with things outside of PortMaster that make use of the patcher gui, and also helpful in not directing everything that uses it to the PortMaster Discord.

image

In practice I tested with the following:

emit_fail_msg() {
    echo "PATCH_FAIL_MSG:$1" >&3
    echo "$1"
}

if [ -z "$VCDIFF" ] || [ ! -x "$VCDIFF" ]; then
    emit_fail_msg "Patching failed: vcdiff tool missing. Try reinstalling the port."
    return 1
fi

This in turn shows both the error to the gui dialog and provides a clean log text file:

GAMEDIR is set to: /roms/ports/zelda-ladxhd/data
Preparing system...
Patching failed: vcdiff tool missing. Try reinstalling the port.
Patching process failed!

Thank you for your efforts and for keeping your tools available for all.

Copy link
Copy Markdown
Contributor

@JanTrueno JanTrueno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants