diff options
Diffstat (limited to 'git2rss')
-rwxr-xr-x | git2rss | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -23,15 +23,6 @@ use Suin\RSSWriter\Channel; use Suin\RSSWriter\Feed; use Suin\RSSWriter\Item; -// Load previous changes -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(); -} - // Current change exec('git log --format=fuller -1', $out); $log = exec("git log --pretty=format:%H,%at,%cn,%an,%s -1"); @@ -56,6 +47,15 @@ $short = substr($entry['hash'], 0, 7); printf("Welcome %s\n", $entry['commiter']); echo "RSS new entry: ${entry['author']} pushed to ${entry['repo']} (${entry['head']},$short): ${entry['comment']}\n"; +// Load previous changes +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(); +} + // 50 recent changes, and save $histo = array_merge([$entry], $histo); while (count($histo) > FEEDSIZE) { |