commit 605ea29387fe026ddce87685ec80bd0225fce319
parent 98b7e3b68f1ab8a407cbc9192bd92c550bd7dd62
Author: markseu <mark2011@mayberg.se>
Date: Wed, 16 Mar 2022 23:03:40 +0100
Better troubleshooting for command line
Diffstat:
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/system/extensions/install.php b/system/extensions/install.php
@@ -2,7 +2,7 @@
// Install extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/install
class YellowInstall {
- const VERSION = "0.8.63";
+ const VERSION = "0.8.64";
const PRIORITY = "1";
public $yellow; // access to API
@@ -69,21 +69,28 @@ class YellowInstall {
if ($this->yellow->system->get("updateCurrentRelease")=="none") {
$this->checkCommandRequirements();
$statusCode = $this->updateLog();
+ if (empty($command)) {
+ $statusCode = 304;
+ echo "Your website is ready for installation. Please type 'php yellow.php serve'\n";
+ }
if ($command=="build" || $command=="clean") {
if ($statusCode==200) $statusCode = $this->updateLanguages();
if ($statusCode==200) $statusCode = $this->updateSettings();
if ($statusCode==200) $statusCode = $this->removeInstall();
}
+ if ($statusCode>=400) {
+ echo "ERROR installing files: ".$this->yellow->page->get("pageError")."\n";
+ echo "Your website has not been installed: Please run command again\n";
+ }
} else {
$statusCode = $this->removeInstall();
$this->yellow->log($statusCode==200 ? "info" : "error", "Uninstall extension 'Install ".YellowInstall::VERSION."'");
+ if ($statusCode>=400) {
+ echo "ERROR updating files: ".$this->yellow->page->get("pageError")."\n";
+ echo "Your website has not been updated: Please run command again\n";
+ }
}
- if ($statusCode==200) {
- $statusCode = 0;
- } else {
- echo "ERROR updating files: ".$this->yellow->page->get("pageError")."\n";
- echo "Your website has ".($statusCode!=200 ? "not " : "")."been updated: Please run command again\n";
- }
+ if ($statusCode==200) $statusCode = 0;
return $statusCode;
}
diff --git a/system/extensions/update-current.ini b/system/extensions/update-current.ini
@@ -64,11 +64,11 @@ media/images/photo.jpg: photo.jpg, create, optional
media/thumbnails/photo-100x40.jpg: photo-100x40.jpg, create, optional
Extension: Install
-Version: 0.8.63
+Version: 0.8.64
Description: Install a brand new, shiny website.
HelpUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/install
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/install.zip
-Published: 2022-03-16 15:02:38
+Published: 2022-03-16 22:45:28
Developer: Datenstrom
Status: unlisted
system/extensions/install.php: install.php, create