utils

package
v0.5.0-beta Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 15 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(stagePath string, repo string) string

CloneRepo clones a repo into the specified location.

func CloneTemplate added in v1.0.0

func CloneTemplate(repo string)

CloneTemplate creates the template directory and clones the template repo into it.

func DieIfError added in v1.0.0

func DieIfError(err error, message string)

DieIfError kills the program if err is not nil.

func GetEnv

func GetEnv(lookup string, fallback string) string

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

func GetTemplateDir added in v1.0.0

func GetTemplateDir(repo string) string

GetTemplateDir gets the location of the template directory.

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 InitTemplate added in v1.0.0

func InitTemplate(repo string, exec string, linuxloc string, macloc string, windowsloc string)

InitTemplate initializes a template repo for the repo name specified.

func InstallFlavours added in v0.4.0

func InstallFlavours(baseDir string, mode string, flavour string, ctprc structs.Program, installLoc string)

InstallFlavours is a wrapper for InstallLinks which takes the flavour and handles the install accordingly

func InstallLinks(baseDir string, entry structs.Entry, to string, finalDir string, mode string)

InstallLinks is a wrapper over MakeLinks that parses the mode and uses it to create the correct link, as specified by the ctprc.

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 its 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