Replace special characters by encoded version on windows #21 #22

This commit is contained in:
hartator 2016-02-09 10:29:27 -06:00
parent c5eb4cd319
commit 00b40492b4

View File

@ -102,6 +102,9 @@ class WaybackMachineDownloader
dir_path = backup_path + file_path_elements[0..-2].join('/') dir_path = backup_path + file_path_elements[0..-2].join('/')
file_path = backup_path + file_path_elements[0..-1].join('/') file_path = backup_path + file_path_elements[0..-1].join('/')
end end
if Gem.win_platform?
file_path = file_path.gsub(/[:*?<>\\|]/) {|s| '%' + s.ord.to_s(16) }
end
unless File.exists? file_path unless File.exists? file_path
begin begin
structure_dir_path dir_path structure_dir_path dir_path