mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Merge branch 'main' into download-ignore-pattern
This commit is contained in:
commit
f9fc7e773d
1 changed files with 1 additions and 13 deletions
|
|
@ -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.check())
|
||||
|
||||
p := processor{cfg: cfg}
|
||||
errCheck(lock(cfg.LockFile, p.process))
|
||||
options.ErrorCheck(lock(cfg.LockFile, p.process))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue