path

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

path from https://github.com/therootcompany/pathman with some minor changes

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

View Source
const (
	HWND_BROADCAST   = uintptr(0xffff)
	WM_SETTINGCHANGE = uintptr(0x001A)
)

Variables

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

Functions

func CheckOS

func CheckOS() string

func GetExecutablePath

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

func IsSet(path string) bool

func IsSubPath

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

func UnsetENV(path string) error

Types

type Config

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

Jump to

Keyboard shortcuts

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