Commit 16bd1c06 authored by Christian Giupponi's avatar Christian Giupponi

By default add the 1.0.0 version to all modules generated with asgard:module:scaffold

parent 09fcd83c
...@@ -227,6 +227,7 @@ class ModuleScaffold ...@@ -227,6 +227,7 @@ class ModuleScaffold
$moduleJson = $this->loadProviders($moduleJson); $moduleJson = $this->loadProviders($moduleJson);
$moduleJson = $this->setModuleOrderOrder($moduleJson); $moduleJson = $this->setModuleOrderOrder($moduleJson);
$moduleJson = $this->setModuleVersion($moduleJson);
$moduleJson = $this->removeStartPhpFile($moduleJson); $moduleJson = $this->removeStartPhpFile($moduleJson);
$this->finder->put($this->getModulesPath('module.json'), $moduleJson); $this->finder->put($this->getModulesPath('module.json'), $moduleJson);
...@@ -259,6 +260,16 @@ JSON; ...@@ -259,6 +260,16 @@ JSON;
return str_replace('"order": 0,', '"order": 1,', $content); return str_replace('"order": 0,', '"order": 1,', $content);
} }
/**
* Set the module version to 1.0.0 by default
* @param string $content
* @return string
*/
private function setModuleVersion($content)
{
return str_replace("\"active\"", "\"version\": \"1.0.0\",\n\t\"active\"", $content);
}
/** /**
* Remove the start.php start file * Remove the start.php start file
* Also removes the auto loading of that file * Also removes the auto loading of that file
...@@ -301,7 +312,7 @@ JSON; ...@@ -301,7 +312,7 @@ JSON;
$replace = <<<JSON $replace = <<<JSON
"description": "", "description": "",
"type": "asgard-module", "type": "asgard-module",
"license": "MIT", "license": "MIT",
"require": { "require": {
"php": ">=7.0.0", "php": ">=7.0.0",
"composer/installers": "~1.0", "composer/installers": "~1.0",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment