mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-19 03:52:25 -05:00
15 lines
352 B
Ruby
15 lines
352 B
Ruby
|
old_pkgs =
|
||
|
if(::File.exist?(node[:omnibus_updater][:cache_dir]))
|
||
|
Dir.glob(File.join(node[:omnibus_updater][:cache_dir], 'chef*')).find_all do |file|
|
||
|
!file.include?(node[:omnibus_updater][:version]) && !file.scan(/\.(rpm|deb)$/).empty?
|
||
|
end
|
||
|
else
|
||
|
[]
|
||
|
end
|
||
|
|
||
|
old_pkgs.each do |filename|
|
||
|
file filename do
|
||
|
action :delete
|
||
|
end
|
||
|
end
|