How to set default output path `site-cookbooks` when using `knife cookbook create`

StackOverflow https://stackoverflow.com/questions/22162666

  •  19-10-2022
  •  | 
  •  

문제

Is there way to set default output path cookbooks to site-cookbooks when I run knife cookbook create?

I wrote cookbook_path in ~/.chef/knife.rb like this.

cookbook_path ['./site-cookbooks']

But this doesn't change default cookbook output path.

도움이 되었습니까?

해결책

File expansion can be wonky in Ruby sometimes. If your site-cookbooks directory is at ~/site-cookbooks, then you could put in something like this in your knife.rb:

current_dir = File.dirname(__FILE__)
cookbook_path ["#{current_dir}/../site-cookbooks"]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top