Better troubleshooting for command line

This commit is contained in:
markseu 2022-03-16 23:03:40 +01:00
parent 98b7e3b68f
commit 605ea29387
2 changed files with 16 additions and 9 deletions

View file

@ -2,7 +2,7 @@
// Install extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/install // Install extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/install
class YellowInstall { class YellowInstall {
const VERSION = "0.8.63"; const VERSION = "0.8.64";
const PRIORITY = "1"; const PRIORITY = "1";
public $yellow; // access to API public $yellow; // access to API
@ -69,21 +69,28 @@ class YellowInstall {
if ($this->yellow->system->get("updateCurrentRelease")=="none") { if ($this->yellow->system->get("updateCurrentRelease")=="none") {
$this->checkCommandRequirements(); $this->checkCommandRequirements();
$statusCode = $this->updateLog(); $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 ($command=="build" || $command=="clean") {
if ($statusCode==200) $statusCode = $this->updateLanguages(); if ($statusCode==200) $statusCode = $this->updateLanguages();
if ($statusCode==200) $statusCode = $this->updateSettings(); if ($statusCode==200) $statusCode = $this->updateSettings();
if ($statusCode==200) $statusCode = $this->removeInstall(); 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 { } else {
$statusCode = $this->removeInstall(); $statusCode = $this->removeInstall();
$this->yellow->log($statusCode==200 ? "info" : "error", "Uninstall extension 'Install ".YellowInstall::VERSION."'"); $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) { if ($statusCode==200) $statusCode = 0;
$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";
}
return $statusCode; return $statusCode;
} }

View file

@ -64,11 +64,11 @@ media/images/photo.jpg: photo.jpg, create, optional
media/thumbnails/photo-100x40.jpg: photo-100x40.jpg, create, optional media/thumbnails/photo-100x40.jpg: photo-100x40.jpg, create, optional
Extension: Install Extension: Install
Version: 0.8.63 Version: 0.8.64
Description: Install a brand new, shiny website. Description: Install a brand new, shiny website.
HelpUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/install HelpUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/install
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/install.zip 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 Developer: Datenstrom
Status: unlisted Status: unlisted
system/extensions/install.php: install.php, create system/extensions/install.php: install.php, create