diff options
author | Mugen Kenichi <mugen.kenichi@uninets.eu> | 2012-07-18 12:07:16 +0200 |
---|---|---|
committer | Mugen Kenichi <mugen.kenichi@uninets.eu> | 2012-07-18 12:07:16 +0200 |
commit | bb34abd5186c0d87126b13af8643614d0aa50367 (patch) | |
tree | a4fd36377a16d60ec72b4cd61291b7a7785e9891 | |
parent | 11034217a7ea3cffe6e0fe631837c518b8c7e1a5 (diff) | |
download | zsh-bb34abd5186c0d87126b13af8643614d0aa50367.tar.gz zsh-bb34abd5186c0d87126b13af8643614d0aa50367.tar.bz2 zsh-bb34abd5186c0d87126b13af8643614d0aa50367.zip |
check for knife.rb in cwd
this is useful when managing multiple chef servers
-rw-r--r-- | plugins/knife/_knife | 6 |
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 |