Skip to content

Commit

Permalink
Merge branch 'master' into 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Schröder committed Sep 18, 2017
2 parents 8e27c9b + 5b389d9 commit 82b9b7f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
19 changes: 15 additions & 4 deletions Classes/Command/GenerateCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,17 @@ public function componentCommand(
* @param string $suffix (optional) The suffix of the fusion file
* @param bool $force (optional) Force overriding of existing files
*/
public function fusionCommand(string $configType, string $name, string $packageKey = '' ,bool $subFolder = false ,string $extends = '' ,string $nameAppendix = '', string $suffix = '.fusion', bool $force = false) {
public function fusionCommand(string $configType, string $name, string $packageKey = '' ,bool $subFolder = false ,string $extends = '' ,string $nameAppendix = '', string $suffix = '', bool $force = false) {
$packageKey = $this->resolvePackageKey($packageKey);
$dynamicConfig = call_user_func([$this, 'get' . $configType . 'Config']);

$targetPath = (isset($dynamicConfig['fusion']['targetPath'])) ? $dynamicConfig['fusion']['targetPath'] : '';
$templatePath = (isset($dynamicConfig['fusion']['templatePath'])) ? $dynamicConfig['fusion']['templatePath'] : 'resource://Vectoholic.NeosCli/Private/Templates/Generator/Fusion';
$nameAppendixFromConfig = (isset($dynamicConfig['fusion']['nameAppendix'])) ? $dynamicConfig['fusion']['nameAppendix'] : '';
$nameAppendix = ($nameAppendix == '') ? $nameAppendixFromConfig : $nameAppendix;
$nameAppendix = ($nameAppendix === '') ? $nameAppendixFromConfig : $nameAppendix;

$suffixFromConfig = (isset($dynamicConfig['fusion']['suffix'])) ? $dynamicConfig['fusion']['suffix'] : '';
$suffix = ($suffix === '') ? $suffixFromConfig : $suffix;

$this->generatorService->generateFusion($name, $packageKey, $targetPath, $subFolder, $nameAppendix, $suffix, $templatePath, $extends, $force);

Expand All @@ -228,12 +231,14 @@ public function fusionCommand(string $configType, string $name, string $packageK
* @param string $suffix
* @param bool $force
*/
public function templateCommand(string $configType, string $name, string $packageKey = '', bool $subFolder = false , string $suffix = '.html', bool $force = false) {
public function templateCommand(string $configType, string $name, string $packageKey = '', bool $subFolder = false , string $suffix = '', bool $force = false) {
$packageKey = $this->resolvePackageKey($packageKey);
$dynamicConfig = call_user_func([$this, 'get' . $configType . 'Config']);

$targetPath = (isset($dynamicConfig['template']['targetPath'])) ? $dynamicConfig['template']['targetPath'] : '';
$templatePath = (isset($dynamicConfig['template']['templatePath'])) ? $dynamicConfig['template']['templatePath'] : 'resource://Vectoholic.NeosCli/Private/Templates/Generator/View';
$suffixFromConfig = (isset($dynamicConfig['template']['suffix'])) ? $dynamicConfig['template']['suffix'] : '';
$suffix = ($suffix === '') ? $suffixFromConfig : $suffix;
$this->generatorService->generateTemplate($name, $packageKey, $targetPath, $subFolder, $suffix, $templatePath, $force);
$calledFrom = debug_backtrace()[1]['function'];
$hideStatus = ($calledFrom == 'nodeTypeCommand' || $calledFrom == 'componentCommand') ? true : false;
Expand All @@ -252,13 +257,15 @@ public function templateCommand(string $configType, string $name, string $packag
* @param string $suffix
* @param bool $force
*/
public function javascriptCommand(string $configType, string $name, string $packageKey = '', bool $subFolder = false ,$suffix = '.js', bool $force = false) {
public function javascriptCommand(string $configType, string $name, string $packageKey = '', bool $subFolder = false ,$suffix = '', bool $force = false) {
$packageKey = $this->resolvePackageKey($packageKey);

$dynamicConfig = call_user_func([$this, 'get' . $configType . 'Config']);

$targetPath = (isset($dynamicConfig['javascript']['targetPath'])) ? $dynamicConfig['javascript']['targetPath'] : '';
$templatePath = (isset($this->nodeTypeConfig['javascript']['templatePath'])) ? $this->nodeTypeConfig['javascript']['templatePath'] : 'resource://Vectoholic.NeosCli/Private/Templates/Generator/Assets';
$suffixFromConfig = (isset($dynamicConfig['javascript']['suffix'])) ? $dynamicConfig['javascript']['suffix'] : '';
$suffix = ($suffix === '') ? $suffixFromConfig : $suffix;
$this->generatorService->generateJavascript($name, $packageKey, $targetPath, $subFolder, $suffix, $templatePath, $force);

$calledFrom = debug_backtrace()[1]['function'];
Expand All @@ -283,6 +290,8 @@ public function stylesheetCommand(string $configType, string $name, string $pack

$targetPath = (isset($dynamicConfig['styles']['targetPath'])) ? $dynamicConfig['styles']['targetPath'] : '';
$templatePath = (isset($dynamicConfig['styles']['templatePath'])) ? $dynamicConfig['styles']['templatePath'] : 'resource://Vectoholic.NeosCli/Private/Templates/Generator/Assets';
$suffixFromConfig = (isset($dynamicConfig['styles']['suffix'])) ? $dynamicConfig['styles']['suffix'] : '';
$suffix = ($suffix === '') ? $suffixFromConfig : $suffix;
$this->generatorService->generateStylesheet($name, $packageKey, $targetPath, $subFolder, $suffix, $templatePath, $force);

$calledFrom = debug_backtrace()[1]['function'];
Expand Down Expand Up @@ -311,6 +320,8 @@ public function translationCommand(string $configType, string $name, string $pac
$targetPathFromConfig = (isset($dynamicConfig['translation']['targetPath'])) ? $dynamicConfig['translation']['targetPath'] : '';
$targetPath = ($targetPath == '') ? $targetPathFromConfig : $targetPath;
$templatePath = (isset($dynamicConfig['translation']['templatePath'])) ? $dynamicConfig['translation']['templatePath'] : 'resource://Vectoholic.NeosCli/Private/Templates/Generator/Assets';
$suffixFromConfig = (isset($dynamicConfig['translation']['suffix'])) ? $dynamicConfig['translation']['suffix'] : '';
$suffix = ($suffix === '') ? $suffixFromConfig : $suffix;
$this->generatorService->generateTranslation($name, $packageKey, $sourceLanguageKey, $targetLanguageKeys, $templatePath, $targetPath, $suffix);

$calledFrom = debug_backtrace()[1]['function'];
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Vectoholic:
styles:
targetPath: 'Private/Assets/Styles'
templatePath: 'resource://Vectoholic.NeosCli/Private/Templates/Generator/Assets'
suffix: '.scss'
suffix: '.css'
autoGenerate: true
translation:
## Define a path inside the Resource/Private/Translations/{language}/ folder. Keep in mind
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "vectoholic/neos-cli",
"type": "neos-package",
"description": "Utility-Tools to create a Neos Site like generating sets of needed files. ",
"description": "Utility-Tools to create a Neos Site.",
"license": "MIT",
"require": {
"neos/neos": "~3.1.0"
"neos/neos": "~3.2.0"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit 82b9b7f

Please sign in to comment.