subdir = make_dest_filename(from_utf8(File.basename(child.attributes['path'])))
rightful_images << "thumbnails-#{subdir}.jpg"
}
- to_del = Dir.entries(dest_dir).find_all { |e| !File.directory?("#{dest_dir}/#{e}") && !rightful_images.include?(e) } - themestuff - themestuff_root
+ to_del = Dir.entries(dest_dir).find_all { |e| !File.directory?(File.join(dest_dir, e)) && !rightful_images.include?(e) } - themestuff - themestuff_root
if to_del.size > 0
- system("rm -f " + to_del.collect { |e| "'#{dest_dir}/#{e}'" }.join(' '))
+ File.delete(to_del.collect { |e| File.join(dest_dir, e) })
end
end
#- copy any resource file that goes with the theme (css, images..)
themestuff.each { |entry|
- if !File.exists?("#{dest_dir}/#{entry}")
+ if !File.exists?(File.join(dest_dir, entry))
psys("cp '#{$FPATH}/themes/#{$theme}/#{entry}' '#{dest_dir}'")
end
}
#- copy any root-only resource file that goes with the theme (css, images..)
if xmldir.parent.name != 'dir'
themestuff_root.each { |entry|
- if !File.exists?("#{dest_dir}/#{entry}")
+ if !File.exists?(File.join(dest_dir, entry))
psys("cp '#{$FPATH}/themes/#{$theme}/root/#{entry}' '#{dest_dir}'")
end
}
concat(thumbnail_videos.collect { |e| e[1] }.flatten).
concat(videos).
push('.htaccess')
- to_del = Dir.entries(dest_dir).find_all { |e| !File.directory?("#{dest_dir}/#{e}") && !all_elements.include?(e) && e !~ /^thumbnails-\w+\.jpg/ } - themestuff - themestuff_root
+ to_del = Dir.entries(dest_dir).find_all { |e| !File.directory?(File.join(dest_dir, e)) && !all_elements.include?(e) && e !~ /^thumbnails-\w+\.jpg/ } - themestuff - themestuff_root
if to_del.size > 0
msg 3, _("\tcleaning up: #{to_del.join(', ')}")
- system("rm -f " + to_del.collect { |e| "#{dest_dir}/#{e}" }.join(' '))
+ File.delete(to_del.collect { |e| File.join(dest_dir, e) })
end
#- copy any resource file that goes with the theme (css, images..)
themestuff.each { |entry|
- if !File.exists?("#{dest_dir}/#{entry}")
+ if !File.exists?(File.join(dest_dir, entry))
psys("cp '#{$FPATH}/themes/#{$theme}/#{entry}' '#{dest_dir}'")
end
}
#- copy any root-only resource file that goes with the theme (css, images..)
if xmldir.parent.name != 'dir'
themestuff_root.each { |entry|
- if !File.exists?("#{dest_dir}/#{entry}")
+ if !File.exists?(File.join(dest_dir, entry))
psys("cp '#{$FPATH}/themes/#{$theme}/root/#{entry}' '#{dest_dir}'")
end
}