Skip to content

Commit

Permalink
Package now sees component script file as optional too
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge authored Jan 31, 2023
1 parent 9e010f3 commit 79d1840
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Tasks/Deploy/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ private function addFiles($zip, $path = null)
*/
public function createComponentZip()
{
$comZip = new \ZipArchive(JPATH_BASE . "/dist", \ZipArchive::CREATE);

$comZip = new \ZipArchive(JPATH_BASE . "/dist", \ZipArchive::CREATE);
$tmp_path = '/dist/tmp/cbuild';
$componentScriptPath = $this->current . "/administrator/components/com_" . $this->getExtensionName() . "/script.php";

if (file_exists(JPATH_BASE . $tmp_path))
{
Expand Down Expand Up @@ -295,7 +295,11 @@ public function createComponentZip()
$this->addFiles($comZip, JPATH_BASE . $tmp_path);

$comZip->addFile($this->current . "/" . $this->getExtensionName() . ".xml", $this->getExtensionName() . ".xml");
$comZip->addFile($this->current . "/administrator/components/com_" . $this->getExtensionName() . "/script.php", "script.php");

if (file_exists($componentScriptPath))
{
$comZip->addFile($componentScriptPath, "script.php");
}

// Close the zip archive
$comZip->close();
Expand Down

0 comments on commit 79d1840

Please sign in to comment.