ruby 小脚本搞定CVS服务器更换后checkout下来的工程迁移
程序员文章站
2022-04-09 20:35:35
def changecvs(path) dir.foreach(path) do |dir| if dir != "." && dir != ".." absdir = p...
def changecvs(path)
dir.foreach(path) do |dir|
if dir != "." && dir != ".."
absdir = path + "/" + dir
if (file.directory? absdir) && (dir == "cvs")
cvs_root_file_name = absdir + "/root"
p cvs_root_file_name
file.open(cvs_root_file_name,"w") do |file|
file.write(":connection_type:user@ip:repository")
end
elsif file.directory? absdir
changecvs(absdir)
end
end
end
end
changecvs("c:/workspace")
dir.foreach(path) do |dir|
if dir != "." && dir != ".."
absdir = path + "/" + dir
if (file.directory? absdir) && (dir == "cvs")
cvs_root_file_name = absdir + "/root"
p cvs_root_file_name
file.open(cvs_root_file_name,"w") do |file|
file.write(":connection_type:user@ip:repository")
end
elsif file.directory? absdir
changecvs(absdir)
end
end
end
end
changecvs("c:/workspace")
上一篇: 详解Sed命令的用法与正则表达式元字符
下一篇: pytorch实现图像风格迁移