mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-06-22 22:27:08 +00:00
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.
29 lines
564 B
Go
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)
|
|
}
|