summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Workman <workmad3@gmail.com>2014-09-04 21:06:50 +0100
committerDavid Workman <workmad3@gmail.com>2014-09-04 21:06:50 +0100
commitbe631d50f68f56b6077965d56e2986da1e262ae3 (patch)
treebc1a0d761d5e9e69bf1fa8b9d22fb2c416569b12
parentd3e373eb2412b9b0727f015c5f8ed0453fa891a8 (diff)
downloadchef-be631d50f68f56b6077965d56e2986da1e262ae3.tar.gz
Expanding the file name before checking existance
-rw-r--r--lib/chef/application/apply.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/chef/application/apply.rb b/lib/chef/application/apply.rb
index a88f0c0c46..ef208a20be 100644
--- a/lib/chef/application/apply.rb
+++ b/lib/chef/application/apply.rb
@@ -94,11 +94,10 @@ class Chef::Application::Apply < Chef::Application
if file_name.nil?
Chef::Application.fatal!("No recipe file was provided", 1)
else
- recipe_path = file_name
+ recipe_path = File.expand_path(file_name)
unless File.exist?(recipe_path)
Chef::Application.fatal!("No file exists at #{recipe_path}", 1)
end
- recipe_path = File.expand_path(recipe_path)
recipe_fh = open(recipe_path)
recipe_text = recipe_fh.read
[recipe_text, recipe_fh]