expandpath

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DisableCache bool

TODO refactor later DisableCache will disable caching of the homeCaps directory. Caching is enabled by default.

Functions

func EnvironmentVarExpand

func EnvironmentVarExpand(pathContainsEnvVariablesStartingDollar string) string

EnvironmentVarExpand function takes a string input and replaces any word that starts with "$" in the input with its expanded path (if exists) and returns the new string.

func GetEnvironmentVariables

func GetEnvironmentVariables(
	pathContainsEnvVarStartingDollarSymbol string,
) *[]string

getVariables function takes a string input and identifies every word that begins with "$" or every word within two "%" in that input string then returns an array of those words. If input is empty or has no such word then returns nil.

func Home

func Home(path string) (string, *errorwrapper.Wrapper)

Home expands the path to include the homeCaps directory if the path is prefixed with `~`. If it isn't prefixed with `~`, the path is returned as-is. Reference : https://bit.ly/3rZbbKH

Types

This section is empty.

Jump to

Keyboard shortcuts

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