Auto-open merged pdf also in Linux

Signed-off-by: Ettore Dreucci <ettore.dreucci@gmail.com>
This commit is contained in:
2020-04-23 16:41:25 +02:00
parent 8bcb48e012
commit ea67a94445
2 changed files with 13 additions and 6 deletions

4
.gitignore vendored
View File

@@ -25,3 +25,7 @@ _testmain.go
.settings
*.code-workspace
.vscode
# bin dir
bin
bin/*

View File

@@ -174,14 +174,17 @@ func mergeInvoices(files []string) string {
}
func openPDF(fileName string) {
var cmd *exec.Cmd
if runtime.GOOS == "windows" {
cmd := exec.Command("cmd", "/C start "+fileName)
cmd = exec.Command("cmd", "/C start "+fileName)
} else {
cmd = exec.Command("xdg-open", fileName)
}
err := cmd.Run()
if err != nil {
log.Fatalf("Impossibile aprire il pdf con le fatture unite: %v\n", err)
}
}
//TODO for Linux
}
func main() {