欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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")