Last active
March 27, 2018 11:23
-
-
Save succi0303/23e5c089f42687b055c725bd8ba9c1c9 to your computer and use it in GitHub Desktop.
pwd配下(サブディレクトリ含む)のファイルの拡張子を`git mv`で一括変更する。txt -> md
This file contains hidden or 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
| Dir.glob("**/*.txt").each do |t| | |
| src = File.expand_path(t) | |
| dist = src.gsub(/txt$/, "md") | |
| cmd = "git mv #{src} #{dist}" | |
| puts "Execute '#{cmd}'" | |
| `#{cmd}` | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment