~jcc/addr-book-combine

ba715e94520a1c9db2d42522b9e38dade77ca728 — Jason Cox 5 months ago f042ce6
Don't fail when command exits with non-zero status

Some commands, like khard, exit with a failure status when no entries
are found. No results is fine, and other address books may have entries
that still need to be displayed. Print a warning log instead.
1 files changed, 2 insertions(+), 1 deletions(-)

M parse.go
M parse.go => parse.go +2 -1
@@ 4,6 4,7 @@ import (
	"bufio"
	"fmt"
	"io"
	"log"
	"os"
	"os/exec"
	"strconv"


@@ 53,7 54,7 @@ func commandToBook(command string) (book, error) {
	}

	if err := cmd.Wait(); err != nil {
		return nil, fmt.Errorf("failed to run %s: %w", command, err)
		log.Printf("warning: failed to run %s: %v", command, err)
	}

	return book, nil