Skip to content

Instantly share code, notes, and snippets.

@venj
Created April 27, 2011 02:04
Show Gist options
  • Save venj/943598 to your computer and use it in GitHub Desktop.
Save venj/943598 to your computer and use it in GitHub Desktop.
Clean up .url files in downloads
#!/usr/bin/env ruby
# Usage: clean_url_files.rb path_to_clean
require 'fileutils'
exit if (ARGV[0].nil? || File.exists?(ARGV[0]))
FileUtils.cd(ARGV[0]) do
files = Dir["**/*"]
files.each do |file|
FileUtils.rm file if file =~ /\.url$/
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment