Skip to content

Commit c268185

Browse files
committed
Utilize the API when generating download button
1 parent 5e66af6 commit c268185

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

public/index.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,13 @@
9393
});
9494

9595
$app->get('/', function (Application $app) {
96-
$currentVersion = 'v0.5.0';
97-
$repository = $app['config']['app']['github_url'];
96+
$release = $app['api']->getRelease('latest');
9897

9998
return $app->render('home.twig', [
100-
'changelog_url' => "{$repository}/releases/{$currentVersion}",
99+
'changelog_url' => $release['changelog_url'],
101100
'expiration_date' => date('m/d/Y', strtotime('+1 day')),
102-
'download_url' => "{$repository}/releases/download/{$currentVersion}/{$currentVersion}-prepackaged.zip",
103-
'download_version' => $currentVersion,
101+
'download_url' => $release['download_url'],
102+
'download_version' => $release['version'],
104103
'github_url' => $app['config']['app']['github_url'],
105104
'home' => true,
106105
]);

0 commit comments

Comments
 (0)