forked from kyma-project/kyma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
42 lines (35 loc) · 878 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
package main
import (
"fmt"
"io/ioutil"
"os"
"github.com/kyma-project/kyma/components/helm-broker/internal"
"github.com/kyma-project/kyma/components/helm-broker/internal/ybundle"
"github.com/sirupsen/logrus"
)
func main() {
logger := logrus.New()
logger.Formatter = &logrus.TextFormatter{
FullTimestamp: true,
}
dir, err := ioutil.TempDir("", "bundlechecker")
if err != nil {
panic(err)
}
loader := ybundle.NewLoader(dir, logger.WithField("service", "bundle checker"))
if len(os.Args) < 2 {
fmt.Println("Provide path to a bundle")
return
}
bundle, _, err := loader.LoadDir(os.Args[1])
if err != nil {
fmt.Println(err)
os.Exit(1)
}
printBundleInfo(bundle)
}
func printBundleInfo(b *internal.Bundle) {
fmt.Printf("Bundle name: %s\n", b.Name)
fmt.Printf("Version: %s\n", b.Version.String())
fmt.Printf("Description: %s\n", b.Description)
}