Skip to content
This repository has been archived by the owner on Mar 1, 2018. It is now read-only.

Commit

Permalink
Merge 9b36084 into c09209d
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricky Chilcott committed Oct 10, 2013
2 parents c09209d + 9b36084 commit e1980dc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/tasks/chore.rake
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,16 @@ namespace :chore do
puts "No unused branches found"
end
end

desc "Destroy package files that aren't associated with a package"
task :destroy_unused_package_files => :environment do
Dir["#{Munki::Application::PACKAGE_DIR}/*.*"].each {|path|
filename = File.basename(path)

if Package.where(:installer_item_location => filename).empty?
puts "Deleting #{path}"
File.delete(path)
end
}
end
end

0 comments on commit e1980dc

Please sign in to comment.