directory(relative_path)
public
Remove each directory in
the given path from right to left. Remove each subdirectory if it exists
and is a directory.
Show source
def directory(relative_path)
parts = relative_path.split('/')
until parts.empty?
partial = File.join(parts)
path = destination_path(partial)
if File.exists?(path)
if Dir[File.join(path, '*')].empty?
logger.rmdir partial
unless options[:pretend]
if options[:svn]
if options[:svn][relative_path]
system("svn revert #{path}")
FileUtils.rmdir(path)
else
system("svn rm #{path}")
end
else
FileUtils.rmdir(path)
end
end
else
logger.notempty partial
end
else
logger.missing partial
end
parts.pop
end
end