summaryrefslogtreecommitdiffstats
path: root/git2rss
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2017-03-28 08:39:29 +0200
committerRemi Collet <fedora@famillecollet.com>2017-03-28 08:39:29 +0200
commitab869251cdab8f4576e98a6e7f30edf07bdd20a7 (patch)
treefd90c514fd842870c27d430bdaae1233676fef14 /git2rss
parenta921f6c9902b0917137e13de370dbdd431aba8a7 (diff)
chain git update-server-info
Diffstat (limited to 'git2rss')
-rwxr-xr-xgit2rss7
1 files changed, 6 insertions, 1 deletions
diff --git a/git2rss b/git2rss
index e36bb12..50e5964 100755
--- a/git2rss
+++ b/git2rss
@@ -27,6 +27,7 @@ use Suin\RSSWriter\Item;
if (file_exists(__DIR__ . '/git2rss.json')) {
$json = file_get_contents(__DIR__ . '/git2rss.json');
$histo = json_decode($json, true);
+ printf("RSS %d entries loaded\n", count($histo));
} else {
$histo = array();
}
@@ -42,7 +43,7 @@ if (substr($entry['repo'], -4) != '.git') {
$entry['repo'] .= '.git';
}
$short = substr($entry['hash'], 0, 7);
-echo "\nRSS ENTRY: ${entry['author']} pushed to ${entry['repo']} (${entry['head']},$short): ${entry['comment']}\n";
+echo "RSS new entry: ${entry['author']} pushed to ${entry['repo']} (${entry['head']},$short): ${entry['comment']}\n";
// 50 recent changes, and save
$histo = array_merge([$entry], $histo);
@@ -82,4 +83,8 @@ foreach ($histo as $entry) {
// Save RSS
file_put_contents(__DIR__ . '/index.html', $feed);
+printf("RSS %d entries saved\n", count($histo));
+
+// standard usage
+passthru('git update-server-info');