utils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolAnd added in v0.3.0

func BoolAnd(first bool, second bool) bool

BoolAnd uses booleans in an AND operator

func CheckBetter added in v0.3.0

func CheckBetter(check int, better int, checkbetter bool) (int, bool)

CheckBetter checks if better is greater than check. If it is, it returns better, otherwise it returns check. It also returns a BoolAnd of checkbetter and if better > check.

func CloneRepo added in v0.2.4

func CloneRepo(repo string) string

CloneRepo clones a repo into the specified location.

func GetEnv

func GetEnv(lookup string, fallback string) string

GetEnv gets an environment variable. If not defined, it gets the fallback.

func HandleDir added in v0.2.4

func HandleDir(dir string) string

HandleDir handles a directory, replacing certain parts with known attributes.

func HandleDirPath added in v0.2.4

func HandleDirPath(finalDir string, name string)

HandleDirPath is a function to handle a directory when making a symlink

func HandleFilePath added in v0.2.4

func HandleFilePath(finalDir string, name string)

HandleFilePath handles files that are made with symlinks

func IsWindows

func IsWindows() bool

IsWindows checks if OS is Windows

func ListContains added in v0.3.0

func ListContains(list []string, contains string) bool

ListContains checks if a list of strings contains a string

func MakeLinks(baseDir string, links []string, to string, finalDir string)

MakeLinks loops through a list and converts it's attributes into arguments for MakeLink.

func PathExists

func PathExists(path string) bool

PathExists checks if a path exists

func PullUpdates added in v0.2.4

func PullUpdates(repo string)

PullUpdates opens a git repo and pulls the latest changes.

func SearchRepos added in v0.3.0

func SearchRepos(repos structs.SearchRes, term string) structs.SearchEntry

SearchRepos searches through a SearchRes for the best match

func ShareDir added in v0.2.4

func ShareDir() string

ShareDir generates the share directory for the cli.

func UpdateJSON added in v0.3.0

func UpdateJSON()

UpdateJSON makes a search request for all Catppuccin repos and caches them.

func UserHomeDir added in v0.2.4

func UserHomeDir() string

UserHomeDir gets the user's home directory

Types

This section is empty.

Jump to

Keyboard shortcuts

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