| 1 |
package reporters |
| 2 |
|
| 3 |
import "runtime" |
| 4 |
|
| 5 |
type intellij struct{} |
| 6 |
|
| 7 |
// NewIntelliJReporter creates a new reporter for IntelliJ. |
| 8 |
func NewIntelliJReporter() Reporter { |
| 9 |
return &intellij{} |
| 10 |
} |
| 11 |
|
| 12 |
func (s *intellij) Report(approved, received string) bool { |
| 13 |
xs := []string{"diff", received, approved} |
| 14 |
|
| 15 |
var programName string |
| 16 |
switch runtime.GOOS { |
| 17 |
case "windows": |
| 18 |
programName = "C:/Program Files (x86)/JetBrains/IntelliJ IDEA 2016/bin/idea.exe" |
| 19 |
case "darwin": |
| 20 |
programName = "/Applications/IntelliJ IDEA.app/Contents/MacOS/idea" |
| 21 |
} |
| 22 |
|
| 23 |
return launchProgram(programName, approved, xs...) |
| 24 |
} |