path

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package path is useful for managing PATH as part of the Environment in the Windows HKey Local User registry. It returns an error for most operations on non-Windows systems.

Index

Constants

This section is empty.

Variables

View Source
var CommonExtensions = []string{"", ".exe", ".bat"}

Functions

func CheckOS

func CheckOS() string

func GetExecutablePath added in v0.0.4

func GetExecutablePath(path, toolName string) (string, bool)

func GetOsData

func GetOsData() string

func IndexOf

func IndexOf(paths []string, p string) (int, error)

IndexOf searches the given path list for first occurence of the given path entry and returns the index, or -1

func IsSet added in v0.0.5

func IsSet(path string) bool

func IsSubPath added in v0.0.5

func IsSubPath(parent, sub string) bool

IsSubPath determines if sub is a subdirectory of parent

func NormalizePathEntry

func NormalizePathEntry(pathentry string) (string, string, error)

NormalizePathEntry will return the given directory path relative from its absolute path to the %USERPROFILE% (home) directory.

func SetENV

func SetENV(path string) error

func UnsetENV added in v0.0.5

func UnsetENV(path string) error

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

func (*Config) GetRCFilePath added in v0.0.5

func (c *Config) GetRCFilePath() (string, error)

Jump to

Keyboard shortcuts

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