Commit ffe7ba4b authored by Andrew Myhre's avatar Andrew Myhre Committed by Guilhem Lettron
Browse files

adds options resource for custom command line args

parent a91716ce
......@@ -30,6 +30,7 @@ def load_current_resource
@current_resource.version(@new_resource.version)
@current_resource.source(@new_resource.source)
@current_resource.args(@new_resource.args)
@current_resource.options(@new_resource.options)
@current_resource.package(@new_resource.package)
@current_resource.exists = true if package_exists?(@current_resource.package, @current_resource.version)
@current_resource.upgradeable = true if upgradeable?(@current_resource.package)
......@@ -70,6 +71,10 @@ def cmd_args
output = ''
output += " -source #{@current_resource.source}" if @current_resource.source
output += " -ia '#{@current_resource.args}'" unless @current_resource.args.to_s.empty?
@current_resource.options.each do |k, v|
output += " -#{k}"
output += " #{v}" if v
end
output
end
......
......@@ -4,6 +4,7 @@ attribute :package, :kind_of => String, :name_attribute => true
attribute :source, :kind_of => String
attribute :version, :kind_of => String
attribute :args, :kind_of => String
attribute :options, :kind_of => Hash, default => {}
def initialize(*args)
super
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment