Skip to content

Instantly share code, notes, and snippets.

View dhoer's full-sized avatar

Dennis Hoer dhoer

  • Zoox
  • San Francisco Bay Area
View GitHub Profile
@dhoer
dhoer / deps.rb
Created December 12, 2013 18:19
Adds version info to knife deps output. Kudos to bjbishop for providing this hack.
require 'chef/chef_fs/knife'
class Chef
class Knife
class Deps < Chef::ChefFS::Knife
banner "knife deps PATTERN1 [PATTERNn]"
category "path-based"
deps do
@dhoer
dhoer / knife_dep.rb
Created December 12, 2013 18:14
Invokes knife deps in a ruby class
require 'chef/knife/bootstrap'
class MyKnife
class MyCLI
include Mixlib::CLI
end
def deps(knife_config_path, cookbooks)
Dir.chdir(File.dirname(knife_config_path))
Chef::Config.from_file(knife_config_path)