This commit is contained in:
Nuno Cruces 2022-12-02 14:23:05 +00:00
parent 1e3170a3d3
commit 7f62cdabe7

View file

@ -11,6 +11,7 @@ import (
"os/exec" "os/exec"
"runtime" "runtime"
"strconv" "strconv"
"strings"
"sync/atomic" "sync/atomic"
"time" "time"
) )
@ -78,8 +79,7 @@ func (d *progressDialog) wait(extra *string, out *bytes.Buffer) {
case eerr.ExitCode() == -1 && atomic.LoadInt32(&d.closed) != 0: case eerr.ExitCode() == -1 && atomic.LoadInt32(&d.closed) != 0:
err = nil err = nil
case eerr.ExitCode() == 1: case eerr.ExitCode() == 1:
out := bytes.TrimSuffix(out.Bytes(), []byte{'\n'}) if extra != nil && *extra == strings.TrimSuffix(out.String(), "\n") {
if extra != nil && *extra == string(out) {
err = ErrExtraButton err = ErrExtraButton
} else { } else {
err = ErrCanceled err = ErrCanceled