Created
November 18, 2016 09:47
-
-
Save artyom/04bff2bd42d4ff0cece17ce21f3b1638 to your computer and use it in GitHub Desktop.
Show gopher when current working directory is under GOPATH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__pschar () { | |
IFS=':' read -ra PDIRS <<< "$GOPATH" | |
for P in "${PDIRS[@]}" ; do | |
test "${1#$P}" = "$1" || { | |
printf "" | |
return | |
} | |
done | |
printf "¶" | |
} | |
PS1='...$(__pschar "$PWD") ' | |
pcd () { cd $(go list -f '{{.Dir}}' .../$1) ; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment