Replace python script with Go short_path tool

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2017-11-18 14:58:00 +01:00
parent 78deaebf73
commit 0386675bbc
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
2 changed files with 1 additions and 19 deletions

View file

@ -80,7 +80,7 @@ function build_git_prompt {
echo -n "%{$reset_color%} ${bracket_close}"
}
local current_dir='$($HOME/bin/short_path)'
local current_dir='$(short_path)'
local git_info='$(build_git_prompt)'
local bracket_open="%{$FG[239]%}[%{$reset_color%}"

View file

@ -1,18 +0,0 @@
#!/usr/bin/env python
import os
path = os.getcwd()
path = path.replace(os.environ["HOME"], "~")
path_parts = path.split("/")
path = ""
for part in path_parts[:-2]:
if len(part) > 0:
path = "{}/{}".format(path, part[0])
else:
path = "{}/{}".format(path, part)
path = "{}/{}".format(path, "/".join(path_parts[-2:]))
print path[1:]