mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-06-03 01:44:53 +00:00

refactor: move from io/ioutil to io and os packages The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. [1]: https://golang.org/doc/go1.16#ioutil Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
29 lines
555 B
Go
29 lines
555 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/kairos-io/kairos/internal/kairos"
|
|
|
|
"github.com/kairos-io/kairos/pkg/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 := kairos.BrandingFile("banner")
|
|
if _, err := os.Stat(brandingFile); err == nil {
|
|
f, err := os.ReadFile(brandingFile)
|
|
if err == nil {
|
|
fmt.Println(string(f))
|
|
}
|
|
|
|
}
|
|
utils.PrintBanner(b)
|
|
}
|