Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mirror
chocolatey-cookbook
Commits
ffe7ba4b
Commit
ffe7ba4b
authored
Sep 10, 2014
by
Andrew Myhre
Committed by
Guilhem Lettron
Sep 10, 2014
Browse files
adds options resource for custom command line args
parent
a91716ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
providers/default.rb
View file @
ffe7ba4b
...
...
@@ -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
...
...
resources/default.rb
View file @
ffe7ba4b
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment