util

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureConfigFilePath

func EnsureConfigFilePath(path string) (string, error)

EnsureConfigFilePath ensure the config file path. it mkdir -p the file's directory if not exist also returns abs path of file name if it starts from `~` or `$HOME` path must be "dir" not "file"

func ExpandHomeDir

func ExpandHomeDir(f string) (string, error)

ExpandHomeDir returns abs path of filename if it starts with one of `~` or `$HOME` e.g.

~/.config/envp/config.yaml -> /<Users|home>/someone/.config/envp/config.yaml
$HOME/.config/envp/config.yaml -> /<Users|home>/someone/.config/envp/config.yaml
/tmp/somepath -> /tmp/somepath

Types

This section is empty.

Jump to

Keyboard shortcuts

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