Skip to content

Commit

Permalink
Merge pull request #106 from nextcloud/feat/capabilities/extract-core…
Browse files Browse the repository at this point in the history
…-capabilities
  • Loading branch information
provokateurin authored Apr 8, 2024
2 parents 214f599 + ac478a5 commit 664743c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions generate-spec
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,20 @@ if (file_exists($definitionsPath)) {

$capabilities = null;
$publicCapabilities = null;
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($sourceDir));
$capabilitiesFiles = [];
foreach ($iterator as $file) {
$path = $file->getPathname();
if (!str_ends_with($path, ".php")) {
continue;
$capabilitiesDirs = [$sourceDir];
if ($appIsCore) {
$capabilitiesDirs[] = $sourceDir . '/../lib/private';
}
foreach ($capabilitiesDirs as $dir) {
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir));
foreach ($iterator as $file) {
$path = $file->getPathname();
if (!str_ends_with($path, ".php")) {
continue;
}
$capabilitiesFiles[] = $path;
}
$capabilitiesFiles[] = $path;
}
sort($capabilitiesFiles);
foreach ($capabilitiesFiles as $path) {
Expand Down

0 comments on commit 664743c

Please sign in to comment.