From 50794276789aba5f1da3971dcc7c30f63a9dc0c8 Mon Sep 17 00:00:00 2001 From: mappu Date: Mon, 4 May 2020 18:08:27 +1200 Subject: [PATCH] codesite2git: normalise some image file extensions --- codesite2git | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/codesite2git b/codesite2git index 2ddba86..a957787 100755 --- a/codesite2git +++ b/codesite2git @@ -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');