Skip to content

Commit cd75e4a

Browse files
committed
fixes
1 parent 88d1b91 commit cd75e4a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

contrib/autogen/gen_diagrams_remote.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
$cratepaths = [];
1515
$crate_dates = [];
1616
foreach($json as $crate => $meta) {
17-
chdir($workdir) || die("failed chdir");
17+
chdir($workdir) || die("failed chdir\n");
1818
$output = null;
1919
$url = @$meta['git'];
2020
$branch = @$meta['branch'];
@@ -28,8 +28,8 @@
2828
}
2929

3030
// Get date of last commit
31-
chdir("$cratedir") || die("failed chdir");
32-
exec("git log -1 --format=\%cd", $output, $rc); if($rc) { die("git log failed"); }
31+
chdir($cratedir) || die("failed chdir to '$cratedir'\n");
32+
exec("git log -1 --format=\%cd", $output, $rc); if($rc) { die("git log failed\n"); }
3333
$last_commit_date = date('Y-m-d', @strtotime(trim(implode("\n", $output))));
3434
$crate_dates[$crate] = $last_commit_date;
3535

@@ -45,7 +45,7 @@
4545
escapeshellarg($diagrams_dir),
4646
implode(' ', $cratepaths));
4747

48-
shell($cmd) && die("");
48+
shell($cmd) && die("\n");
4949

5050
gen_html_index($diagrams_dir, $json, $crate_dates);
5151

@@ -54,6 +54,7 @@
5454
exit(0);
5555

5656
function shell($cmd) {
57+
echo "executing cmd: $cmd\n";
5758
passthru($cmd, $rc);
5859
return $rc;
5960
}
@@ -103,8 +104,8 @@ function gen_html_index($diagrams_dir, $json, $crate_dates) {
103104
$buf .= sprintf('<tr class="%s"><td>%s</td><td><a href="%s">bare</a></td><td><a href="%s">compact</a></td><td><a href="%s">full</a></td><td><a href="%s">repo</a></td><td><a href="%s">crates.io</a></td><td><a href="%s">docs.rs</a></td><td>%s</td></tr>', $class, $crate, $bare, $compact, $full, $url, $crate_io_url, $docs_rs_url, $last_commit_date) . "\n";
104105
$cnt ++;
105106
}
106-
$buf .= "</table></body></html>";
107+
$buf .= "</table><p id='footer'>built with <a href='https://github.com/dan-da/ml'>ml</a>.</p></body></html>";
107108
$path = sprintf('%s/%s', $diagrams_dir, 'index.html');
108-
file_put_contents($path, $buf) || die("could not write index.html");
109+
file_put_contents($path, $buf) || die("could not write index.html\n");
109110
}
110111
?>

0 commit comments

Comments
 (0)