Skip to content

Commit

Permalink
feat[ui]: version checker in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
sk33z3r committed Jun 26, 2022
1 parent 0d1ab1d commit 2851144
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$version = file_get_contents('./.version');
$version = "v" . file_get_contents('./.version');
$mint_config = "./.secrets/config.json";
$transfer_config = "./.secrets/transfer_config.json";
$progress_file = "./php/progress.json";
Expand All @@ -26,7 +26,14 @@
if ($redirect !== "TRUE") {
include "php/header.html"; ?>
<div class="content">
<h1><a href="/">LooPyGen</a> v<?php echo $version ?></h1>
<h1><a href="/">LooPyGen</a> <?php echo $version ?></h1>
<?php
$ver_cmd = 'curl --silent "https://api.github.com/repos/sk33z3r/LooPyGen/releases/latest" | grep \'"tag_name":\' | sed -E \'s/.*"([^"]+)".*/\1/\'';
exec($ver_cmd, $latest, $code);
if ($version !== $latest[0]) {
echo "<h3 class='info'>LooPyGen $latest[0] is available!<br />Download the update from the companion app.</h3>";
}
?>
<?php include "php/$page.php"; ?>
</div>
<?php } else {
Expand Down

0 comments on commit 2851144

Please sign in to comment.