@@ -26,7 +26,13 @@ class PullModel extends \JModelDatabase
2626 * @var array
2727 * @since 2.0
2828 */
29- protected $ nonProductionFolders = array ('build ' , 'docs ' , 'installation ' , 'tests ' , '.github ' );
29+ protected $ nonProductionFolders = array (
30+ 'build ' ,
31+ 'docs ' ,
32+ 'installation ' ,
33+ 'tests ' ,
34+ '.github ' ,
35+ );
3036
3137 /**
3238 * Array containing non-production files
@@ -44,6 +50,14 @@ class PullModel extends \JModelDatabase
4450 'phpunit.xml.dist ' ,
4551 'robots.txt.dist ' ,
4652 'travisci-phpunit.xml ' ,
53+ 'LICENSE ' ,
54+ 'RoboFile.dist.ini ' ,
55+ 'RoboFile.php ' ,
56+ 'codeception.yml ' ,
57+ 'jorobo.dist.ini ' ,
58+ 'manifest.xml ' ,
59+ 'crowdin.yaml ' ,
60+ 'travis-lang-update.sh ' ,
4761 );
4862
4963 /**
@@ -80,10 +94,21 @@ protected function parseFileList($files)
8094 }
8195 }
8296
97+ // Sometimes the repo filename is not the production file name
98+ $ prodFileName = $ file ->filename ;
99+ $ filePath = explode ('/ ' , $ prodFileName );
100+
101+ // Remove the `src` here to match the CMS paths if needed
102+ if ($ filePath [0 ] === 'src ' )
103+ {
104+ $ prodFileName = str_replace ('src/ ' , '' , $ prodFileName );
105+ }
106+
83107 $ parsedFiles [] = (object ) array (
84- 'action ' => $ file ->status ,
85- 'filename ' => $ file ->filename ,
86- 'fileurl ' => $ file ->contents_url ,
108+ 'action ' => $ file ->status ,
109+ 'filename ' => $ prodFileName ,
110+ 'repofilename ' => $ file ->filename ,
111+ 'fileurl ' => $ file ->contents_url ,
87112 );
88113 }
89114
@@ -178,7 +203,7 @@ public function apply($id)
178203 try
179204 {
180205 $ contentsResponse = $ github ->getFileContents (
181- $ pull ->head ->user ->login , $ this ->getState ()->get ('github_repo ' ), $ file ->filename , urlencode ($ pull ->head ->ref )
206+ $ pull ->head ->user ->login , $ this ->getState ()->get ('github_repo ' ), $ file ->repofilename , urlencode ($ pull ->head ->ref )
182207 );
183208
184209 $ contents = json_decode ($ contentsResponse ->body );
0 commit comments