]> arthur.barton.de Git - OhMyZshExtensions.git/blobdiff - plugins/boot2docker/boot2docker.plugin.zsh
Change plugins to not do anything if tool isn't available
[OhMyZshExtensions.git] / plugins / boot2docker / boot2docker.plugin.zsh
index 9813acdb487943a97b10475169cf3d531f3fb281..8a63173ea4d893769fbfce2acb185391e72f790d 100644 (file)
@@ -1,8 +1,10 @@
 # boot2docker.plugin.zsh
 
-boot2docker status | fgrep "running" >/dev/null
-if [ $? -eq 0 ]; then
-       # boot2docker VM is running
-       eval `boot2docker shellinit 2>/dev/null`
-       DOCKER_HOST_IPA=${(z)${(s.:.)DOCKER_HOST#tcp://}[1]}
+if (( $+commands[boot2docker] )); then
+       boot2docker status | fgrep "running" >/dev/null
+       if [ $? -eq 0 ]; then
+               # boot2docker VM is running
+               eval `boot2docker shellinit 2>/dev/null`
+               DOCKER_HOST_IPA=${(z)${(s.:.)DOCKER_HOST#tcp://}[1]}
+       fi
 fi