From 7b85c52a92b5128aebe13682b6c28a135e0dcf15 Mon Sep 17 00:00:00 2001 From: christian-dale Date: Thu, 21 Apr 2022 19:26:47 +0200 Subject: [PATCH 1/2] Fix bugs with updateer --- lib/class/Updater.php | 6 +++--- lib/configs/verbatimcms.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/class/Updater.php b/lib/class/Updater.php index 4b43abd..993769b 100644 --- a/lib/class/Updater.php +++ b/lib/class/Updater.php @@ -34,9 +34,9 @@ public function releaseAvailable() { } public static function update($release) { - file_put_contents("lib/{$release["assets"][0]["name"]}", file_get_contents($release["assets"][0]["browser_download_url"])); + file_put_contents("lib/{$release["tag_name"]}", file_get_contents($release["assets"][0]["browser_download_url"])); $zip = new \ZipArchive(); - $zip->open("lib/{$release["assets"][0]["name"]}"); + $zip->open("lib/{$release["tag_name"]}"); $zip->extractTo("lib/update"); $zip->close(); @@ -45,7 +45,7 @@ public static function update($release) { \App\Util::copyRecursive("lib/update/vendor", "./vendor"); self::updateConfigs($release); - unlink("lib/{$release["assets"][0]["name"]}"); + unlink("lib/{$release["tag_name"]}"); } private static function loadConfigs() { diff --git a/lib/configs/verbatimcms.json b/lib/configs/verbatimcms.json index ada0f6a..687d645 100644 --- a/lib/configs/verbatimcms.json +++ b/lib/configs/verbatimcms.json @@ -1,6 +1,6 @@ { - "version": "1.0.0-beta.3", - "lastUpdateCheck": 1650322877, + "version": "v1.0.0-beta.3", + "lastUpdateCheck": 1650561861, "betaReleases": true, "updated": true } From 54c86e7d64723b701614556247b7b77ee49ff56b Mon Sep 17 00:00:00 2001 From: christian-dale Date: Thu, 21 Apr 2022 19:31:41 +0200 Subject: [PATCH 2/2] Fix more bugs with updater --- lib/class/Updater.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/class/Updater.php b/lib/class/Updater.php index 993769b..3b81cab 100644 --- a/lib/class/Updater.php +++ b/lib/class/Updater.php @@ -36,7 +36,7 @@ public function releaseAvailable() { public static function update($release) { file_put_contents("lib/{$release["tag_name"]}", file_get_contents($release["assets"][0]["browser_download_url"])); $zip = new \ZipArchive(); - $zip->open("lib/{$release["tag_name"]}"); + $zip->open("lib/VerbatimCMS-{$release["tag_name"]}"); $zip->extractTo("lib/update"); $zip->close();