Skip to content

Instantly share code, notes, and snippets.

@kytruong
Created March 22, 2011 03:34
Show Gist options
  • Save kytruong/880721 to your computer and use it in GitHub Desktop.
Save kytruong/880721 to your computer and use it in GitHub Desktop.
def cmd_cp(files)
path = fjoin(admin_share, workdir)
cmd_mkdir([path])
files.each do |file|
if File.directory?(file)
FileUtils.cp_r(file, path, {:verbose => true})
else
FileUtils.cp(file, fjoin(path, File.basename(file)), {:verbose => true})
end
end
end
def cmd_solo(args)
cmd = ruby_bin('chef-solo')
{:c => '-c', :solo => 'solo.rb', :j => '-j', :node => 'node.rb'
}.each do |opt,val|
if File.exists?(fjoin(admin_share, workdir, val))
cmd << opt << val
end
end
cmd_exec(cmd << args)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment