mirror of
https://github.com/Noettore/fattureCCSR.git
synced 2025-10-15 11:46:39 +02:00
Auto-open merged pdf also in Linux
Signed-off-by: Ettore Dreucci <ettore.dreucci@gmail.com>
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -25,3 +25,7 @@ _testmain.go
|
||||
.settings
|
||||
*.code-workspace
|
||||
.vscode
|
||||
|
||||
# bin dir
|
||||
bin
|
||||
bin/*
|
@@ -174,15 +174,18 @@ 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() {
|
||||
var fileName string
|
||||
|
Reference in New Issue
Block a user