M
Martin DeMello
Just learning my way around CVS - is this missing anything? It seems to
work, but that's just programming by coincidence
# recursive cvs add
require 'find'
def cvs_addable?(file)
!(['.','..','CVS'].include?(File.basename(file)))
end
dirs = []
Find.find (ARGV[0]) {|file|
if FileTest.directory?(file)
a << file if cvs_addable?(file)
end
}
dirs.each {|dir|
Dir.chdir(dir)
puts "cd #{dir}"
Dir.foreach('.') {|file|
system("cvs add #{file}") if cvs_addable?(file)
}
}
work, but that's just programming by coincidence
# recursive cvs add
require 'find'
def cvs_addable?(file)
!(['.','..','CVS'].include?(File.basename(file)))
end
dirs = []
Find.find (ARGV[0]) {|file|
if FileTest.directory?(file)
a << file if cvs_addable?(file)
end
}
dirs.each {|dir|
Dir.chdir(dir)
puts "cd #{dir}"
Dir.foreach('.') {|file|
system("cvs add #{file}") if cvs_addable?(file)
}
}