Refactor
This commit is contained in:
13
pkg/homedir/expand.go
Normal file
13
pkg/homedir/expand.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package homedir
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func Expand(path string) string {
|
||||
if path[0:2] == "~/" {
|
||||
return os.Getenv("HOME") + path[1:]
|
||||
} else {
|
||||
return path
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user