Created
May 25, 2016 02:17
-
-
Save milligramme/429be5ae23d586027a483c1fb1dd1ef6 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
require 'date' | |
require 'fileutils' | |
include FileUtils | |
data = DATA.read | |
root, *paths = data.split("\n") | |
puts root | |
today_dir = File.expand_path("~/Desktop/#{Date.today.to_s}/#{File.basename(root)}") | |
mkdir_p today_dir unless File.exist? today_dir | |
# paths = | |
paths.each { |e| mkdir_p "#{today_dir}/#{File.dirname(e)}" unless File.dirname(e) == "." } | |
paths.each { |e| cp_r "#{File.expand_path root}/#{e}", "#{today_dir}/#{e}" } | |
# 1行目に基準パス | |
# それ以降に git diff --name-only したリスト | |
__END__ | |
/path/to/repo | |
lib/something/anything.rb | |
lib/something/version.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment