Method: Chef::FileCache.delete

Defined in:
lib/chef/file_cache.rb

.delete(path) ⇒ Object

Delete a file from the File Cache

Parameters

path<String>

The path to the file you want to delete - should

be relative to Chef::Config[:file_cache_path]

Returns

true



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/chef/file_cache.rb', line 128

def delete(path)
  validate(
    {
      :path => path
    },
    {
      :path => { :kind_of => String },
    }
  )
  cache_path = create_cache_path(path, false)
  if File.exists?(cache_path)
    File.unlink(cache_path)
  end
  true
end