Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
require 'fileutils'
move_to_dir = ARGV[0] ||
puts <<usage
Project Archiver
Tell me what to do with each entry. Enter nothing to skip.
- Entries which you move will go to #{move_to_dir}.
- Entries which you junk will for to .junk.
ctrl-c to exit at any time.
Dir.foreach(Dir.pwd) do |entry|
unless entry =~ /^\.|^[\d]{4}|#{move_to_dir}/
print "#{entry} (move/junk) or skip: "
case gets.chomp
when /^m(ove)?$/ entry, move_to_dir
when /^j(unk)?$/ entry, '.junk'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment