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
|
.settings
|
||||||
*.code-workspace
|
*.code-workspace
|
||||||
.vscode
|
.vscode
|
||||||
|
|
||||||
|
# bin dir
|
||||||
|
bin
|
||||||
|
bin/*
|
@@ -174,14 +174,17 @@ func mergeInvoices(files []string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func openPDF(fileName string) {
|
func openPDF(fileName string) {
|
||||||
|
var cmd *exec.Cmd
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
cmd := exec.Command("cmd", "/C start "+fileName)
|
cmd = exec.Command("cmd", "/C start "+fileName)
|
||||||
err := cmd.Run()
|
|
||||||
if err != nil {
|
} else {
|
||||||
log.Fatalf("Impossibile aprire il pdf con le fatture unite: %v\n", err)
|
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() {
|
func main() {
|
||||||
|
Reference in New Issue
Block a user