localio

package
v1.9.9 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AptInstall

func AptInstall(packages *InstalledPackages, aptName ...string) error

AptInstall ...

func BrewInstallCaskProgram

func BrewInstallCaskProgram(brewName, brewFullName string, packages *InstalledPackages) error

BrewInstallCaskProgram ...

func BrewInstallProgram

func BrewInstallProgram(brewName, binaryName string, packages *InstalledPackages) error

BrewInstallProgram ...

func BrewTap

func BrewTap(brewTap string, packages *InstalledPackages) error

BrewTap ...

func CmdExec

func CmdExec(args ...string) (string, error)

CmdExec Execute a command and return stdout

func CommandExists

func CommandExists(cmd string) (string, bool)

CommandExists ...

func Contains

func Contains(s []string, str string) bool

Contains checks if a string is present in a slice

func CopyStringToFile

func CopyStringToFile(data, dest string) error

CopyStringToFile ...

func CorrectOS

func CorrectOS(osType string) bool

CorrectOS ... Useful for go tests

func DownloadAndInstallLatestVersionOfGolang

func DownloadAndInstallLatestVersionOfGolang(homeDir string) error

DownloadAndInstallLatestVersionOfGolang Only for linux x86_64. Mac uses homebrew

func DownloadFile

func DownloadFile(dest, url string) error

DownloadFile ...

func EmbedFileCopy

func EmbedFileCopy(dst string, src fs.File) error

EmbedFileCopy ...

func EmbedFileStringAppendToDest

func EmbedFileStringAppendToDest(data []byte, dest string) error

EmbedFileStringAppendToDest takes a slice of bytes and writes it as a string to dest file path

func EmbedFileStringPrependToDest added in v1.7.8

func EmbedFileStringPrependToDest(data []byte, dest string) error

EmbedFileStringPrependToDest takes a slice of bytes and prepend writes it as a string to the beginning of the dest file path

func ExecCMD

func ExecCMD(command string) (string, error)

ExecCMD Execute a command

func Exists

func Exists(path string) (bool, error)

Exists returns whether the given file or directory exists

func GetCPUType

func GetCPUType() string

GetCPUType Returns the CPU type for the current runtime environment

func GitClone added in v1.7.2

func GitClone(url, directory string) error

GitClone clones a public git repo url to directory

func ResolveAbsPath

func ResolveAbsPath(path string) (string, error)

ResolveAbsPath ...

func RunCommandPipeOutput

func RunCommandPipeOutput(command string) error

RunCommandPipeOutput ...

func RunCommands

func RunCommands(cmds []string) error

RunCommands ...

func SetVariableValue

func SetVariableValue(varName, val, osType, configPath string) error

SetVariableValue ...

func StartTmuxSession

func StartTmuxSession() error

StartTmuxSession ...

Types

type AptInstalled

type AptInstalled struct {
	Name []string
}

AptInstalled ...

func NewAptInstalled

func NewAptInstalled() (*AptInstalled, error)

NewAptInstalled ...

type BrewInstalled

type BrewInstalled struct {
	Names         []string
	CaskFullNames []string
	Taps          []string
}

BrewInstalled ...

func NewBrewInstalled

func NewBrewInstalled() (*BrewInstalled, error)

NewBrewInstalled ...

type Directories

type Directories struct {
	HomeDir string
}

Directories ...

func NewDirectories

func NewDirectories() (*Directories, error)

NewDirectories ...

type InstalledPackages

type InstalledPackages struct {
	AptInstalledPackages  *AptInstalled
	BrewInstalledPackages *BrewInstalled
}

InstalledPackages ...

type Record added in v1.7.8

type Record struct {
	Filename string
	Contents []string
}

Record is a type for prepending string text to a file

func NewRecord added in v1.7.8

func NewRecord(filename string) *Record

NewRecord returns the Record type

func (*Record) PrependStringToFile added in v1.7.8

func (r *Record) PrependStringToFile(content string) error

PrependStringToFile prepends a given string to an existing file while preserving the original formatting

Jump to

Keyboard shortcuts

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