From 4c07aca22ee633f5cc6e72835850c81c9b2ee0d1 Mon Sep 17 00:00:00 2001 From: Rico Neitzel Date: Fri, 28 Apr 2017 00:39:50 +0200 Subject: [PATCH 1/2] custom package name --- src/shell/packager.php | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/shell/packager.php b/src/shell/packager.php index 0e368f4..6d914a7 100644 --- a/src/shell/packager.php +++ b/src/shell/packager.php @@ -57,8 +57,9 @@ public function run() if ($this->getArg('composer')) { try { $this->_pathToComposerJson = $this->getArg('composer'); - $name = $this->getModuleName(); - $this->getConfig()->setData('name', $name); + $extension_name = $this->getExtensionName(); + $package_name = $this->getPackageName(); + $this->getConfig()->setData('name', $package_name); $this->getConfig()->setData('channel', $this->getChannel()); $this->getConfig()->setData('license', $this->getLicense()); $this->getConfig()->setData('license_uri', $this->getLicenseUri()); @@ -134,9 +135,24 @@ public function getPathToComposerJSON() * * @return string */ - public function getModuleName() + public function getPackageName() { - $name = $this->getComposerJson()->extra->magento_connect->name; + $name = $this->getComposerJson()->extra->magento_connect->package_name; + if (!$name) { + $name = $this->getComposerJson()->name; + $name = join('_', array_map('ucfirst', explode('/', $name))); + } + return $name; + } + + /** + * Parse module name out of composer module name file. + * + * @return string + */ + public function getExtensionName() + { + $name = $this->getComposerJson()->extra->magento_connect->extension_name; if (!$name) { $name = $this->getComposerJson()->name; $name = join('_', array_map('ucfirst', explode('/', $name))); From 186f94092eb143ecdaecbb5463a91a44b30a61e7 Mon Sep 17 00:00:00 2001 From: Rico Neitzel Date: Wed, 31 May 2017 12:07:40 +0200 Subject: [PATCH 2/2] BugFix Version Grabbing --- src/shell/packager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shell/packager.php b/src/shell/packager.php index 6d914a7..75279f9 100644 --- a/src/shell/packager.php +++ b/src/shell/packager.php @@ -65,7 +65,7 @@ public function run() $this->getConfig()->setData('license_uri', $this->getLicenseUri()); $this->getConfig()->setData('summary', $this->getSummary()); $this->getConfig()->setData('description', $this->getDescription()); - $this->getConfig()->setData('version', (string)Mage::getConfig()->getNode()->modules->$name->version); + $this->getConfig()->setData('version', (string)Mage::getConfig()->getNode()->modules->$extension_name->version); $this->getConfig()->setData('stability', $this->getStability()); $this->getConfig()->setData('authors', $this->getAuthors()); $this->getConfig()->setData('depends_php_min', $this->getPhpMin());