]> arthur.barton.de Git - ax-zsh.git/commitdiff
Add "docker-machine" plugin
authorAlexander Barton <alex@barton.de>
Sun, 16 Aug 2015 11:33:21 +0000 (13:33 +0200)
committerAlexander Barton <alex@barton.de>
Sun, 16 Aug 2015 11:33:21 +0000 (13:33 +0200)
plugins/docker-machine/docker-machine.zprofile [new file with mode: 0644]

diff --git a/plugins/docker-machine/docker-machine.zprofile b/plugins/docker-machine/docker-machine.zprofile
new file mode 100644 (file)
index 0000000..be76d3b
--- /dev/null
@@ -0,0 +1,11 @@
+# AX-ZSH: Alex' Modular ZSH Configuration
+# docker.zprofile: Setup "docker" with "docker-machine"
+
+# Make sure that "docker-machine" is installed
+(( $+commands[docker-machine] )) || return
+
+# Setup environment
+if ! eval "$(docker-machine env local-default)"; then
+       # Clean environment on error
+       eval "$(docker-machine env -u)"
+fi