Skip to content

Commit

Permalink
Fix docker version parsing (spaceship-prompt#582)
Browse files Browse the repository at this point in the history
  • Loading branch information
popmoore authored and salmanulfarzy committed Dec 5, 2018
1 parent 382b058 commit c092d09
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sections/docker.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ spaceship_docker() {
local docker_version=$(docker version -f "{{.Server.Version}}" 2>/dev/null)
[[ -z $docker_version ]] && return

# Split output on separator (-) and return the first element from resulting array
[[ $SPACESHIP_DOCKER_VERBOSE == false ]] && docker_version=${${(@s|-|)docker_version}[1]}
[[ $SPACESHIP_DOCKER_VERBOSE == false ]] && docker_version=${docker_version%-*}

if [[ -n $DOCKER_MACHINE_NAME ]]; then
docker_version+=" via ($DOCKER_MACHINE_NAME)"
Expand Down

0 comments on commit c092d09

Please sign in to comment.