mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-09-12 20:53:37 +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
37
internal/utils/console.go
Normal file
37
internal/utils/console.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"image"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/pterm/pterm"
|
||||
"github.com/qeesung/image2ascii/convert"
|
||||
)
|
||||
|
||||
func Prompt(t string) (string, error) {
|
||||
if t != "" {
|
||||
pterm.Info.Println(t)
|
||||
}
|
||||
answer, err := bufio.NewReader(os.Stdin).ReadString('\n')
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return strings.TrimSpace(answer), nil
|
||||
}
|
||||
|
||||
func PrintBanner(d []byte) {
|
||||
img, _, _ := image.Decode(bytes.NewReader(d))
|
||||
|
||||
convertOptions := convert.DefaultOptions
|
||||
convertOptions.FixedWidth = 100
|
||||
convertOptions.FixedHeight = 40
|
||||
|
||||
// Create the image converter
|
||||
converter := convert.NewImageConverter()
|
||||
fmt.Print(converter.Image2ASCIIString(img, &convertOptions))
|
||||
}
|
Reference in New Issue
Block a user