~rockorager/go-notmuch

bd8c24be9e1cca2ac70568a6161a2483bb0d64a1 — Tim Culverhouse 1 year, 4 months ago b6e2334
cmd: fix Profile and environment

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2 files changed, 3 insertions(+), 2 deletions(-)

M count.go
M notmuch.go
M count.go => count.go +0 -1
@@ 53,7 53,6 @@ func (nm *Notmuch) CountBatch(ctx context.Context, r io.Reader) (*Counts, error)
		stderr: bytes.NewBuffer(nil),
	}
	c.cmd.Args = append(c.cmd.Args, "count", "--batch", "--lastmod")
	c.cmd.Args = append(c.cmd.Args)
	c.cmd.Stdin = r
	c.cmd.Stderr = c.stderr
	c.stdout, err = c.cmd.StdoutPipe()

M notmuch.go => notmuch.go +3 -1
@@ 3,6 3,7 @@ package notmuch
import (
	"context"
	"fmt"
	"os"
	"os/exec"
)



@@ 19,6 20,7 @@ func (nm *Notmuch) new(ctx context.Context) *exec.Cmd {
		cmd.Process.Kill()
		return cmd.Wait()
	}
	cmd.Env = os.Environ()
	if nm.Config != "" {
		config := fmt.Sprintf("NOTMUCH_CONFIG=%s", nm.Config)
		cmd.Env = append(cmd.Env, config)


@@ 28,7 30,7 @@ func (nm *Notmuch) new(ctx context.Context) *exec.Cmd {
		cmd.Env = append(cmd.Env, db)
	}
	if nm.Profile != "" {
		profile := fmt.Sprintf("NOTMUCH_PROFILE=%s", nm.Database)
		profile := fmt.Sprintf("NOTMUCH_PROFILE=%s", nm.Profile)
		cmd.Env = append(cmd.Env, profile)
	}
	if nm.UUID != "" {