...is a command line utility (written in Go) that returns a string representing the current working directory where the name of each parent directory has been shortened to the smallest uniquely identifiable string for the directory in which it resides. The primary intended use case for this utility is to construct the current working directory in the command line prompt. For example, a normal prompt would contain the full path to the current working directory (pwd) in the prompt, but with my shortpath
utility, the prompt is shortened considerably without removing so much information that confusion could occur.
At the moment, it simply walks up the current working directory path and finds the shortest string for each directory that still represents that directory uniquely. This operation has the possibility of being expensive, and since it happens every time you run the command (every time the prompt is shown), it really needs optimized somehow...
# Old:
go get github.com/logavanc/shortpath-go
# New:
go install github.com/logavanc/shortpath-go/cli/shortpath@latest
See documentation on godoc.org.
See the LICENSE file.