Replace python script with Go short_path tool
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
78deaebf73
commit
0386675bbc
2 changed files with 1 additions and 19 deletions
|
@ -80,7 +80,7 @@ function build_git_prompt {
|
||||||
echo -n "%{$reset_color%} ${bracket_close}"
|
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 git_info='$(build_git_prompt)'
|
||||||
|
|
||||||
local bracket_open="%{$FG[239]%}[%{$reset_color%}"
|
local bracket_open="%{$FG[239]%}[%{$reset_color%}"
|
||||||
|
|
|
@ -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:]
|
|
Loading…
Reference in a new issue