summaryrefslogtreecommitdiff
path: root/plugins/knife
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2012-12-05 07:15:34 -0800
committerRobby Russell <robby@planetargon.com>2012-12-05 07:15:34 -0800
commited5d2fff1ff036719c61078309ad55a23230baa5 (patch)
tree2240c8a344f2c8e57b13afcfbd8d7f9a347048f5 /plugins/knife
parentdc2558c52d295a679b464d184821905572f4b991 (diff)
parentbb34abd5186c0d87126b13af8643614d0aa50367 (diff)
downloadzsh-ed5d2fff1ff036719c61078309ad55a23230baa5.tar.gz
zsh-ed5d2fff1ff036719c61078309ad55a23230baa5.tar.bz2
zsh-ed5d2fff1ff036719c61078309ad55a23230baa5.zip
Merge pull request #1233 from mugenken/knife-check-cwd
check for knife.rb in cwd
Diffstat (limited to 'plugins/knife')
-rw-r--r--plugins/knife/_knife6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/knife/_knife b/plugins/knife/_knife
index 8453af5be..dec491257 100644
--- a/plugins/knife/_knife
+++ b/plugins/knife/_knife
@@ -170,7 +170,11 @@ _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() {
- (for i in $( grep cookbook_path $HOME/.chef/knife.rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done)
+ 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)
}
# This function extracts the available cookbook versions on the chef server