@@ -26,7 +26,13 @@ class PullModel extends \JModelDatabase
26
26
* @var array
27
27
* @since 2.0
28
28
*/
29
- protected $ nonProductionFolders = array ('build ' , 'docs ' , 'installation ' , 'tests ' , '.github ' );
29
+ protected $ nonProductionFolders = array (
30
+ 'build ' ,
31
+ 'docs ' ,
32
+ 'installation ' ,
33
+ 'tests ' ,
34
+ '.github ' ,
35
+ );
30
36
31
37
/**
32
38
* Array containing non-production files
@@ -44,6 +50,14 @@ class PullModel extends \JModelDatabase
44
50
'phpunit.xml.dist ' ,
45
51
'robots.txt.dist ' ,
46
52
'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 ' ,
47
61
);
48
62
49
63
/**
@@ -80,10 +94,21 @@ protected function parseFileList($files)
80
94
}
81
95
}
82
96
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
+
83
107
$ 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 ,
87
112
);
88
113
}
89
114
@@ -178,7 +203,7 @@ public function apply($id)
178
203
try
179
204
{
180
205
$ 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 )
182
207
);
183
208
184
209
$ contents = json_decode ($ contentsResponse ->body );
0 commit comments