Skip to content

Commit

Permalink
update on few small issues
Browse files Browse the repository at this point in the history
  • Loading branch information
iruzevic committed May 8, 2024
1 parent 3673cfd commit 4583741
Showing 1 changed file with 6 additions and 26 deletions.
32 changes: 6 additions & 26 deletions src/Init/InitThemeMandatryCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use EightshiftLibs\Cli\AbstractCli;
use EightshiftLibs\Cli\ParentGroups\CliInit;
use EightshiftLibs\Helpers\Helpers;
use WP_CLI;

/**
* Class InitThemeMandatryCli
Expand Down Expand Up @@ -46,11 +47,7 @@ public function getCommandName(): string
*/
public function getDefaultArgs(): array
{
return [
'path' => Helpers::getProjectPaths('projectRoot'),
'file_name' => 'setup.json',
'source_path' => __DIR__,
];
return [];
}

/**
Expand All @@ -62,22 +59,6 @@ public function getDoc(): array
{
return [
'shortdesc' => 'Copy all mandatory theme files to the project.',
'synopsis' => [
[
'type' => 'assoc',
'name' => 'path',
'description' => 'Define absolute folder path where setup file will be created.',
'optional' => true,
'default' => $this->getDefaultArg('path'),
],
[
'type' => 'assoc',
'name' => 'file_name',
'description' => 'Define file that will be created in the path location.',
'optional' => true,
'default' => $this->getDefaultArg('file_name'),
],
],
'longdesc' => $this->prepareLongDesc("
## USAGE
Expand All @@ -103,11 +84,6 @@ public function __invoke(array $args, array $assocArgs)
{
$this->getIntroText($assocArgs);

// Get Props.
$path = $this->getArg($assocArgs, 'path');
$fileName = $this->getArg($assocArgs, 'file_name');
$sourcePath = $this->getArg($assocArgs, 'source_path');

$assocArgs['actionOutput'] = 'created';

$sep = \DIRECTORY_SEPARATOR;
Expand All @@ -126,5 +102,9 @@ public function __invoke(array $args, array $assocArgs)
->renameUse($assocArgs)
->outputWrite($destionation, $file, $assocArgs);
}

WP_CLI::runcommand("wp eval 'shell_exec(\"rm composer.lock\");'");
WP_CLI::runcommand("wp eval 'shell_exec(\"composer install -n --no-cache\");'");
WP_CLI::runcommand("wp eval 'shell_exec(\"npm install\");'");
}
}

0 comments on commit 4583741

Please sign in to comment.