mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-12-24 20:35:03 -07:00
22 lines
529 B
Go
22 lines
529 B
Go
|
// Package paths contains a variety of helper functions responsible for
|
||
|
// computing paths to various things. This package should not depend on any
|
||
|
// other asdf packages.
|
||
|
package paths
|
||
|
|
||
|
import (
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
// RemoveFromPath returns the PATH without asdf shims path
|
||
|
func RemoveFromPath(currentPath, pathToRemove string) string {
|
||
|
var newPaths []string
|
||
|
|
||
|
for _, fspath := range strings.Split(currentPath, ":") {
|
||
|
if fspath != pathToRemove {
|
||
|
newPaths = append(newPaths, fspath)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return strings.Join(newPaths, ":")
|
||
|
}
|