summaryrefslogtreecommitdiff
path: root/chef/lib/chef
diff options
context:
space:
mode:
authorRingo De Smet <ringo.desmet@gmail.com>2010-10-11 16:40:18 +0200
committerDaniel DeLeo <dan@opscode.com>2010-10-18 10:37:13 -0700
commit30ba89b2ff0aa99253e56e9b0740057404112db3 (patch)
tree7accdd91522a6dfdd590027d4e326020738acc78 /chef/lib/chef
parenta5be8b515998e05c452364524f94022ac029fd87 (diff)
downloadchef-30ba89b2ff0aa99253e56e9b0740057404112db3.tar.gz
Support for passing a flag between the interpreter and the script file
Diffstat (limited to 'chef/lib/chef')
-rw-r--r--chef/lib/chef/provider/script.rb2
-rw-r--r--chef/lib/chef/resource/script.rb9
2 files changed, 10 insertions, 1 deletions
diff --git a/chef/lib/chef/provider/script.rb b/chef/lib/chef/provider/script.rb
index 2af4c97dd5..5c0d52e9fd 100644
--- a/chef/lib/chef/provider/script.rb
+++ b/chef/lib/chef/provider/script.rb
@@ -29,7 +29,7 @@ class Chef
set_owner_and_group
- @new_resource.command("\"#{@new_resource.interpreter}\" \"#{script_file.path}\"")
+ @new_resource.command("\"#{@new_resource.interpreter}\" #{@new_resource.flags} \"#{script_file.path}\"")
super
ensure
unlink_script_file
diff --git a/chef/lib/chef/resource/script.rb b/chef/lib/chef/resource/script.rb
index ae28ba787b..e6a8e56c0d 100644
--- a/chef/lib/chef/resource/script.rb
+++ b/chef/lib/chef/resource/script.rb
@@ -28,6 +28,7 @@ class Chef
@command = name
@code = nil
@interpreter = nil
+ @flags = nil
end
def code(arg=nil)
@@ -46,6 +47,14 @@ class Chef
)
end
+ def flags(arg=nil)
+ set_or_return(
+ :flags,
+ arg,
+ :kind_of => [ String ]
+ )
+ end
+
end
end
end