From bcbac4101d57f58bd6a51ec7d3d21db4682fd0f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Ruz=CC=8Cevic=CC=81?= Date: Tue, 14 May 2024 23:36:30 +0200 Subject: [PATCH] initi --- src/Init/InitThemeCli.php | 6 +----- src/Init/InitThemeSetupCli.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Init/InitThemeCli.php b/src/Init/InitThemeCli.php index ad53bdc69..bd77925e5 100644 --- a/src/Init/InitThemeCli.php +++ b/src/Init/InitThemeCli.php @@ -100,10 +100,6 @@ public function __invoke(array $args, array $assocArgs) { $assocArgs = $this->prepareArgs($assocArgs); - $assocArgs[self::ARG_GROUP_OUTPUT] = false; - - $groupOutput = $assocArgs[self::ARG_GROUP_OUTPUT]; - $this->getIntroText($assocArgs); foreach (static::COMMANDS as $item) { @@ -119,7 +115,7 @@ public function __invoke(array $args, array $assocArgs) ); } - if (!$groupOutput) { + if (!$assocArgs[self::ARG_GROUP_OUTPUT]) { $this->cliLogAlert( 'All the files have been copied, you can start working on your awesome theme!', 'success', diff --git a/src/Init/InitThemeSetupCli.php b/src/Init/InitThemeSetupCli.php index 3f32aef75..d075d0650 100644 --- a/src/Init/InitThemeSetupCli.php +++ b/src/Init/InitThemeSetupCli.php @@ -157,7 +157,16 @@ public function __invoke(array $args, array $assocArgs) WP_CLI::runcommand('theme activate ' . $assocArgs[self::ARG_TEXTDOMAIN]); $this->cliLog('--------------------------------------------------', 'C'); $this->cliLog("Installing theme service classes and blocks", 'C'); - WP_CLI::runcommand(\sprintf("boilerplate init theme --%s=true", self::ARG_GROUP_OUTPUT)); + $this->runCliCommand( + InitThemeCli::class, + $this->commandParentName, + array_merge( + $assocArgs, + [ + self::ARG_GROUP_OUTPUT => true, + ] + ) + ); $this->cliLog('--------------------------------------------------', 'C'); $this->cliLog("Building the new theme assets", 'C'); WP_CLI::runcommand("eval 'shell_exec(\"cd {$newDestionation} && npm run build\");'");