Make releases dir configurable
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
/online
|
||||
/releases/*
|
||||
/releases
|
||||
/config.php
|
||||
|
||||
+5
-3
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
$contact_name = "Example Contact";
|
||||
$contact_link = "https://example.com";
|
||||
$contact_name = "Thayol"; // The contact name displayed on the page.
|
||||
$contact_link = "mailto:thayol@uncensored.hu"; // Can be any type of link. This will be a href on the contact name.
|
||||
|
||||
$online_services_source_url = "https://example.com";
|
||||
$online_services_source_url = "https://git.uncensored.hu/supercardinality/supercardinality-online"; // The URL to the online services source.
|
||||
|
||||
$releases_dir = "releases"; // The path to scan for releases.
|
||||
|
||||
@@ -64,7 +64,7 @@ $options = [
|
||||
|
||||
$os_guess = guess_os();
|
||||
|
||||
$latest = json_decode(file_get_contents('releases/latest.json'), true);
|
||||
$latest = json_decode(file_get_contents($releases_dir . '/latest.json'), true);
|
||||
$version = empty($latest["version"]) ? "" : $latest["version"];
|
||||
$version_timestamp = empty($latest["timestamp"]) ? -1 : $latest["timestamp"];
|
||||
$version_timestamp_in_words = timestamp_in_words($version_timestamp);
|
||||
@@ -72,14 +72,14 @@ $version_timestamp_in_words = timestamp_in_words($version_timestamp);
|
||||
if (!empty($latest["linux_path"])) {
|
||||
$options["linux"]["download_path"] = $latest["linux_path"];
|
||||
if (!str_contains($latest["linux_path"], "://")) {
|
||||
$options["linux"]["download_path"] = "releases/" . $options["linux"]["download_path"];
|
||||
$options["linux"]["download_path"] = $releases_dir . "/" . $options["linux"]["download_path"];
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($latest["windows_path"])) {
|
||||
$options["windows"]["download_path"] = $latest["windows_path"];
|
||||
if (!str_contains($latest["windows_path"], "://")) {
|
||||
$options["windows"]["download_path"] = "releases/" . $options["windows"]["download_path"];
|
||||
$options["windows"]["download_path"] = $releases_dir . "/" . $options["windows"]["download_path"];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user