Permalink
Browse files

Fix another bug

  • Loading branch information...
1 parent 532636e commit 9befccff9ceeef53f5ba281e21b3d15a2311ee16 @beberlei beberlei committed Feb 21, 2013
Showing with 23 additions and 22 deletions.
  1. +23 −22 bin/build-apidocs.php
View
@@ -31,6 +31,10 @@
});
foreach ($projectDetails['versions'] as $version => $versionData) {
+ if (isset($versionData['browse_source_link'])) {
+ continue;
+ }
+
$lastTag = array_reduce(
array_filter($tagData, function($tag) use($version) {
return strpos($tag['name'], $version) === 0;
@@ -43,31 +47,28 @@ function ($highestVersion, $testVersion) {
);
$checkout = $lastTag['name'];
- if (isset($versionData['browse_source_link']) && count($versionData['releases'])) {
- $checkout = end(array_keys($versionData['releases']));
- $url = $versionData['browse_source_link'];
- $path = "source/$project";
- if (is_dir($path)) {
- $updateSourceCmd = sprintf("cd %s && git pull && git checkout %s", $path, $checkout);
- } else {
- $updateSourceCmd = sprintf("git clone %s.git %s && cd %s && git checkout %s", $url, $path, $path, $checkout);
- }
-
- chdir(__DIR__ . "/../");
- echo "Executing $updateSourceCmd\n";
- shell_exec($updateSourceCmd);
+ $url = $versionData['browse_source_link'];
+ $path = "source/$project";
+ if (is_dir($path)) {
+ $updateSourceCmd = sprintf("cd %s && git pull && git checkout %s", $path, $checkout);
+ } else {
+ $updateSourceCmd = sprintf("git clone %s.git %s && cd %s && git checkout %s", $url, $path, $path, $checkout);
+ }
- $directory = $output . "/$project/$version";
- if (!file_exists($directory)) {
- echo "Creating directory: $directory\n";
- mkdir($directory, 0777, true);
- }
+ chdir(__DIR__ . "/../");
+ echo "Executing $updateSourceCmd\n";
+ shell_exec($updateSourceCmd);
- chdir(__DIR__ . "/../");
- $apiDocs = sprintf('apigen -s %s -d %s/%s --title "%s"', $path.'/lib/Doctrine', $output, "$project/$version", $projectDetails['title'] );
- echo "Generating API Docs: $apiDocs\n";
- shell_exec($apiDocs);
+ $directory = $output . "/$project/$version";
+ if (!file_exists($directory)) {
+ echo "Creating directory: $directory\n";
+ mkdir($directory, 0777, true);
}
+
+ chdir(__DIR__ . "/../");
+ $apiDocs = sprintf('apigen -s %s -d %s/%s --title "%s"', $path.'/lib/Doctrine', $output, "$project/$version", $projectDetails['title'] );
+ echo "Generating API Docs: $apiDocs\n";
+ shell_exec($apiDocs);
}
}

0 comments on commit 9befccf

Please sign in to comment.