summaryrefslogtreecommitdiff
path: root/plugins/knife
diff options
context:
space:
mode:
authorBen Hartshorne <ben@parse.com>2013-04-01 13:34:59 -0700
committerBen Hartshorne <ben@parse.com>2013-04-01 13:42:33 -0700
commit5c1c536015ea3e87acc19653faf537c0fb22b7ba (patch)
tree7eac054dd93604e88334a34bde20be9743c27d56 /plugins/knife
parentb8b241f630377aacefade327c94655cec96b002f (diff)
downloadzsh-5c1c536015ea3e87acc19653faf537c0fb22b7ba.tar.gz
zsh-5c1c536015ea3e87acc19653faf537c0fb22b7ba.tar.bz2
zsh-5c1c536015ea3e87acc19653faf537c0fb22b7ba.zip
allowing you to override knife paths
Diffstat (limited to 'plugins/knife')
-rw-r--r--plugins/knife/_knife12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/knife/_knife b/plugins/knife/_knife
index dec491257..ca6347957 100644
--- a/plugins/knife/_knife
+++ b/plugins/knife/_knife
@@ -170,11 +170,13 @@ _chef_environments_remote() {
# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
_chef_cookbooks_local() {
- local knife_rb="$HOME/.chef/knife.rb"
- if [ -f ./.chef/knife.rb ]; then
- knife_rb="./.chef/knife.rb"
- fi
- (for i in $( grep cookbook_path $knife_rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done)
+
+ local knife_rb=${KNIFE_CONF_PATH:-${HOME}/.chef/knife.rb}
+ if [ -f ./.chef/knife.rb ]; then
+ knife_rb="./.chef/knife.rb"
+ fi
+ local cookbook_path=${KNIFE_COOKBOOK_PATH:-$(grep cookbook_path $knife_rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' )}
+ (for i in $cookbook_path; do ls $i; done)
}
# This function extracts the available cookbook versions on the chef server