-
-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy pathmain.go
More file actions
46 lines (38 loc) · 977 Bytes
/
main.go
File metadata and controls
46 lines (38 loc) · 977 Bytes
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: MIT
package main
import (
"io"
"log"
"os"
"github.com/rokath/trice/internal/args"
"github.com/spf13/afero"
)
var (
version string // do not initialize, goreleaser will handle that
commit string // do not initialize, goreleaser will handle that
date string // do not initialize, goreleaser will handle that
branch string // like "main"
gitState string // "clean" or "dirty"
gitStatus string // changed file list (from build.sh)
builtBy string // empty or "goreleaser"
)
// main is the entry point.
func main() {
fSys := &afero.Afero{Fs: afero.NewOsFs()}
e := doit(os.Stdout, fSys)
if e != nil {
log.Fatal(e)
}
}
// doit is the action.
func doit(w io.Writer, fSys *afero.Afero) error {
// inject values
args.Version = version
args.Commit = commit
args.Date = date
args.Branch = branch
args.GitState = gitState
args.GitStatus = gitStatus
args.BuiltBy = builtBy
return args.Handler(w, fSys, os.Args)
}