File: beyond_compare.go

package info (click to toggle)
golang-github-approvals-go-approval-tests 0.0~git20180620.6ae1ec6-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 296 kB
  • sloc: xml: 16; makefile: 3
file content (25 lines) | stat: -rw-r--r-- 588 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package reporters

import (
	"runtime"
)

type beyondCompare struct{}

// NewBeyondCompareReporter creates a new reporter for Beyond Compare 4.
func NewBeyondCompareReporter() Reporter {
	return &beyondCompare{}
}

func (s *beyondCompare) Report(approved, received string) bool {
	xs := []string{received, approved}
	var programName string
	switch runtime.GOOS {
	case "windows":
		programName = "C:/Program Files/Beyond Compare 4/BComp.exe"
	case "darwin":
		programName = "/Applications/Beyond Compare.app/Contents/MacOS/bcomp"
	}

	return launchProgram(programName, approved, xs...)
}