-
Notifications
You must be signed in to change notification settings - Fork 172
/
main.go
46 lines (39 loc) · 860 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2021-Present The Zarf Authors
// Package main is the entrypoint for the Zarf binary.
package main
import (
"context"
"embed"
"os"
"os/signal"
"syscall"
"github.com/zarf-dev/zarf/src/cmd"
"github.com/zarf-dev/zarf/src/config"
"github.com/zarf-dev/zarf/src/pkg/lint"
)
//go:embed cosign.pub
var cosignPublicKey string
//go:embed zarf.schema.json
var zarfSchema embed.FS
func main() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
signalCh := make(chan os.Signal, 1)
signal.Notify(signalCh, syscall.SIGINT, syscall.SIGTERM)
go func() {
first := true
for {
<-signalCh
if first {
first = false
cancel()
continue
}
os.Exit(1)
}
}()
config.CosignPublicKey = cosignPublicKey
lint.ZarfSchema = zarfSchema
cmd.Execute(ctx)
}