From 6076b957f93da5d81b44ddff20194e7f68a3af57 Mon Sep 17 00:00:00 2001 From: Semen Martynov Date: Fri, 20 May 2016 20:05:00 +0300 Subject: [PATCH] This closes #34, boxes search will be made either on the default path, or the path defined in the VAGRANT_HOME variable. --- etc/bash_completion.d/vagrant | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/bash_completion.d/vagrant b/etc/bash_completion.d/vagrant index e0d1b47..1376690 100644 --- a/etc/bash_completion.d/vagrant +++ b/etc/bash_completion.d/vagrant @@ -71,7 +71,7 @@ _vagrant() { then case "$prev" in "init") - local box_list=$(find $HOME/.vagrant.d/boxes -mindepth 1 -maxdepth 1 -type d -exec basename {} \;|sed -e 's/-VAGRANTSLASH-/\//') + local box_list=$(find ${VAGRANT_HOME:-$HOME/.vagrant.d}/boxes -mindepth 1 -maxdepth 1 -type d -exec basename {} \;|sed -e 's/-VAGRANTSLASH-/\//') COMPREPLY=($(compgen -W "${box_list}" -- ${cur})) return 0 ;; @@ -133,7 +133,7 @@ _vagrant() { "box") case "$prev" in "remove"|"repackage") - local box_list=$(find $HOME/.vagrant.d/boxes -mindepth 1 -maxdepth 1 -type d -exec basename {} \;|sed -e 's/-VAGRANTSLASH-/\//') + local box_list=$(find ${VAGRANT_HOME:-$HOME/.vagrant.d}/boxes -mindepth 1 -maxdepth 1 -type d -exec basename {} \;|sed -e 's/-VAGRANTSLASH-/\//') COMPREPLY=($(compgen -W "${box_list}" -- ${cur})) return 0 ;;