mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-09-02 09:36:19 +00:00
Split off cli into separate binaries (#37)
* 🎨 Split off cli into separate binaries This commit splits off the cli into 3 binaries: - agent - cli - provider The provider now is a separate component that can be tested by itself and have its own lifecycle. This paves the way to a ligher c3os variant, HA support and other features that can be provided on runtime. This is working, but still there are low hanging fruit to care about. Fixes #14 * 🤖 Add provider bin to releases * ⚙️ Handle signals * ⚙️ Reduce buildsize footprint * 🎨 Scan for providers also in /system/providers * 🤖 Run goreleaser * 🎨 Refactoring
This commit is contained in:
committed by
Itxaka
parent
74bfd373db
commit
63cd28d1cb
33
internal/cmd/utils.go
Normal file
33
internal/cmd/utils.go
Normal file
@@ -0,0 +1,33 @@
|
||||
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 PrintTextFromFile(f string, banner string) {
|
||||
installText := ""
|
||||
text, err := ioutil.ReadFile(f)
|
||||
if err == nil {
|
||||
installText = string(text)
|
||||
}
|
||||
pterm.DefaultBox.WithTitle(banner).WithTitleBottomRight().WithRightPadding(0).WithBottomPadding(0).Println(
|
||||
installText)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
Reference in New Issue
Block a user