kairos-agent/internal/cmd/utils.go
Ettore Di Giacinto 602d086ce4 art: Refactor agent code
Move out cmd pieces and split into its own package. Also make sure we reload
plugins before bootstrapping nodes.

Also commons out the agent configuration in a specific YAML file.
2022-07-18 22:02:49 +00:00

29 lines
564 B
Go

package cmd
import (
"fmt"
"io/ioutil"
"os"
"github.com/c3os-io/c3os/internal/c3os"
"github.com/c3os-io/c3os/internal/utils"
"github.com/pterm/pterm"
)
func PrintText(f string, banner string) {
pterm.DefaultBox.WithTitle(banner).WithTitleBottomRight().WithRightPadding(0).WithBottomPadding(0).Println(
f)
}
func PrintBranding(b []byte) {
brandingFile := c3os.BrandingFile("banner")
if _, err := os.Stat(brandingFile); err == nil {
f, err := ioutil.ReadFile(brandingFile)
if err == nil {
fmt.Println(string(f))
}
}
utils.PrintBanner(b)
}