X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/d6a0fb3ae5ee7ec1719fab4800c28d463d746b0f..10cf60790cf2430aba9f7e7120ccd414959e4f81:/zsh/plugins/knife/_knife diff --git a/zsh/plugins/knife/_knife b/zsh/plugins/knife/_knife index 8453af5..dec4912 100644 --- a/zsh/plugins/knife/_knife +++ b/zsh/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