utils

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFile

func CreateFile(filePath string) (*os.File, error)

func CreateFolder

func CreateFolder(folderPath string) error

func ExecCommand

func ExecCommand(name string, args ...string) error

func FileExists

func FileExists(filePath string) bool

FileExists checks if a file exists

func GenerateFileFromTemplate

func GenerateFileFromTemplate(filePath string, data any, tempContent string)

func GetUserInput

func GetUserInput(prompt string, required bool, requiredMsg string) string

Helper function to gather user input If required is true, it will keep asking for input until it gets a non-empty string. If requiredMsg is provided, it will print the message when input is required

func GetUserInputWithValidation added in v0.2.0

func GetUserInputWithValidation(prompt string, required bool, requiredMsg string, validate func(string) bool, validationMsg string) string

func GetYesOrNoInput

func GetYesOrNoInput(prompt string, defaultYes bool) bool

Helper function to get yes/no input

func IsValidVersion added in v0.2.0

func IsValidVersion(version string) bool

func ProcessSlicesInput

func ProcessSlicesInput(input string) []string

Helper function to process modules input and remove duplicates

func ReadYamlFile

func ReadYamlFile[T any](filePath string) (T, error)

Helper function to read .ebrick.yaml

func WriteYamlFile

func WriteYamlFile[T any](filePath string, data T) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL