codesite2git: normalise some image file extensions

This commit is contained in:
mappu 2020-05-04 18:08:27 +12:00
parent bd70d6ae41
commit 5079427678
1 changed files with 6 additions and 4 deletions

View File

@ -71,13 +71,15 @@ class CProjectGitExporter extends CProject {
}
// Copy all images to a doc/ subdirectory
mkdir($dest.'/doc');
foreach($this->images as $img) {
copy($this->dir.$img, $dest.'/doc/'.$img);
if (count($this->images) > 0) {
mkdir($dest.'/doc');
foreach($this->images as $img) {
// Normalise some legacy file extension variants while we're here
copy($this->dir.$img, $dest.'/doc/'.str_replace(['.jpeg', '.JPG', '.JPEG'], ['.jpg', '.jpg', '.jpg'], $img));
}
}
// Copy all downloads to a dist-archive/ subdirectory
if (count($this->downloads) > 0) {
mkdir($dest.'/dist-archive');