1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-27 08:10:08 +00:00

Create go_prompt_info to add go version to prompts

This commit is contained in:
Grant Stephens 2020-05-14 10:08:10 +01:00 committed by GitHub
parent fd786291ba
commit dbb5bb1fb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

7
lib/golang.zsh Normal file
View file

@ -0,0 +1,7 @@
# get the golang version
function go_prompt_info() {
local go_prompt
go_prompt=$(go version | awk '{ print substr($3, 3) }')
[[ "${go_prompt}x" == "x" ]] && return
echo "${ZSH_THEME_GO_PROMPT_PREFIX}${go_prompt}${ZSH_THEME_GO_PROMPT_SUFFIX}"
}