1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 18:15:42 +01:00

Merge branch 'main' into aggregator-client-certs

This commit is contained in:
Sascha L. Teichmann 2023-08-15 18:58:28 +02:00
commit 411d6ffd16

View file

@ -11,24 +11,13 @@ package main
import (
"fmt"
"log"
"os"
"path/filepath"
"github.com/csaf-poc/csaf_distribution/v2/internal/options"
"github.com/gofrs/flock"
"github.com/jessevdk/go-flags"
)
func errCheck(err error) {
if err != nil {
if flags.WroteHelp(err) {
os.Exit(0)
}
log.Fatalf("error: %v\n", err)
}
}
func lock(lockFile *string, fn func() error) error {
if lockFile == nil {
// No locking configured.
@ -57,7 +46,6 @@ func main() {
_, cfg, err := parseArgsConfig()
options.ErrorCheck(err)
options.ErrorCheck(cfg.prepare())
p := processor{cfg: cfg}
errCheck(lock(cfg.LockFile, p.process))
options.ErrorCheck(lock(cfg.LockFile, p.process))
}