system

package
v0.0.46 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToPATH

func AddToPATH(path string, filename string) error

AddToPATH adds a path to the PATH environment variable in a profile.d script

func CheckStringExists

func CheckStringExists(text string, filepath string) (bool, error)

CheckStringExists checks if a string exists in a file

func DeleteStrings added in v0.0.24

func DeleteStrings(lines []string, filepath string, perm fs.FileMode) error

DeleteStrings deletes a slice of strings from a file

func PrintAndLogInfo added in v0.0.19

func PrintAndLogInfo(message string)

func RunCommand

func RunCommand(command string, displayCommand bool, delay time.Duration, save bool) error

Runs a command in the terminal and streams the output

func RunCommandAndCaptureOutput

func RunCommandAndCaptureOutput(command string, displayCommand bool, delay time.Duration, save bool) (string, error)

Runs a command in the terminal and return stdout/stderr as seperate strings

func VerifyFileExists

func VerifyFileExists(path string) bool

func WriteStrings

func WriteStrings(lines []string, filepath string, perm fs.FileMode, print bool, save bool) error

WriteStrings appends a slice of strings to a file and creates the file if it doesn't exist

Types

This section is empty.

Jump to

Keyboard shortcuts

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