Created
April 6, 2014 06:51
-
-
Save kazuph/10002343 to your computer and use it in GitHub Desktop.
写真整理用。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# coding : utf-8 | |
require 'awesome_print' | |
require 'pry' | |
# このスクリプト以下のファイルを見つけたら、このディレクトリに配置する | |
# 重複を避けるためディレクトリの階層分の名前に変更してmvする | |
Dir.glob("./**/*").each do |fp| | |
next if FileTest.directory?(fp) | |
ap fp | |
re_name = fp.gsub(/\//, '_').sub(/^\._/, './') | |
FileUtils.mv(fp, re_name) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment