I have a variable storing the files which should be keep
default['keep']['files'] = ['a.txt', 'b.txt']
And bellow files exist on the server
'a.txt', 'b.txt', 'c.txt', 'd.txt'
I want to delete those file which is not in default['keep']['files'], i.e. c.txt and d.txt
but I am not able to figure out how to get the list of the files to be deleted.
// How should I get the list so that i can loop it?
???.each do |file_name|
directory "Delete #{file_name}" do
path my_folder_path
recursive true
action :delete
end
end