14
14
$ cratepaths = [];
15
15
$ crate_dates = [];
16
16
foreach ($ json as $ crate => $ meta ) {
17
- chdir ($ workdir ) || die ("failed chdir " );
17
+ chdir ($ workdir ) || die ("failed chdir \n " );
18
18
$ output = null ;
19
19
$ url = @$ meta ['git ' ];
20
20
$ branch = @$ meta ['branch ' ];
28
28
}
29
29
30
30
// 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 " ); }
33
33
$ last_commit_date = date ('Y-m-d ' , @strtotime (trim (implode ("\n" , $ output ))));
34
34
$ crate_dates [$ crate ] = $ last_commit_date ;
35
35
45
45
escapeshellarg ($ diagrams_dir ),
46
46
implode (' ' , $ cratepaths ));
47
47
48
- shell ($ cmd ) && die ("" );
48
+ shell ($ cmd ) && die ("\n " );
49
49
50
50
gen_html_index ($ diagrams_dir , $ json , $ crate_dates );
51
51
54
54
exit (0 );
55
55
56
56
function shell ($ cmd ) {
57
+ echo "executing cmd: $ cmd \n" ;
57
58
passthru ($ cmd , $ rc );
58
59
return $ rc ;
59
60
}
@@ -103,8 +104,8 @@ function gen_html_index($diagrams_dir, $json, $crate_dates) {
103
104
$ 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" ;
104
105
$ cnt ++;
105
106
}
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> " ;
107
108
$ 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 " );
109
110
}
110
111
?>
0 commit comments