package fsutil

import (
	
	
	
)

var pathSep = string(filepath.Separator)

// Getwd returns path of the working directory in a format suitable as the
// prompt.
func () string {
	,  := os.Getwd()
	if  != nil {
		return "?"
	}
	return TildeAbbr()
}

// TildeAbbr abbreviates the user's home directory to ~.
func ( string) string {
	,  := GetHome("")
	if  == "" ||  == "/" {
		// If home is "" or "/", do not abbreviate because (1) it is likely a
		// problem with the environment and (2) it will make the path actually
		// longer.
		return 
	}
	if  == nil {
		if  ==  {
			return "~"
		} else if strings.HasPrefix(, +pathSep) {
			return "~" + [len():]
		}
	}
	return 
}