ruby 小脚本搞定CVS服务器更换后checkout下来的工程迁移
程序员文章站
2022-07-05 12:04:18
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")
上一篇: Laravel 5.4.36 session 生效问题
下一篇: 小宝宝答案很好笑