diff --git a/functions.php b/functions.php deleted file mode 100644 index a0207f8..0000000 --- a/functions.php +++ /dev/null @@ -1,46 +0,0 @@ - + [ + "name" => "Linux", + "architecture" => "x86-64", + "download_path" => "", + "download_filename" => "supercardinality", + ], + "windows" => [ + "name" => "Windows", + "architecture" => "x86-64", + "download_path" => "", + "download_filename" => "supercardinality.exe", + ], +]; + +$os_guess = guess_os(); + +$latest = json_decode(file_get_contents('releases/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); + +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"]; + } +} + +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"]; + } +} + +$display_other_builds = false; +foreach($options as $os => $target) { + if (!empty($target["download_path"])) { + $display_other_builds = true; + } +} + +?> diff --git a/options.php b/options.php deleted file mode 100644 index a960c16..0000000 --- a/options.php +++ /dev/null @@ -1,16 +0,0 @@ - [ - "name" => "Linux", - "architecture" => "x86-64", - "download_path" => "", - "download_filename" => "supercardinality", - ], - "windows" => [ - "name" => "Windows", - "architecture" => "x86-64", - "download_path" => "", - "download_filename" => "supercardinality.exe", - ], -]; diff --git a/script.php b/script.php deleted file mode 100644 index 801fdd8..0000000 --- a/script.php +++ /dev/null @@ -1,33 +0,0 @@ - $target) { - if (!empty($target["download_path"])) { - $display_other_builds = true; - } -}