Skip to content

Commit

Permalink
Merge branch '7.x' into 8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Sep 19, 2023
2 parents 6a9927e + 1fa9cfc commit 81aae88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Concerns/CodeGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function codeAlreadyExists(string $className, string $path): bool
{
$this->components->error(
sprintf(
'%s [%s] already exists!', $this->type, Str::after($path, $this->generatorPreset()->basePath())
'%s [%s] already exists!', $this->type, Str::after($path, $this->generatorPreset()->basePath().DIRECTORY_SEPARATOR)
)
);

Expand All @@ -83,7 +83,7 @@ public function codeHasBeenGenerated(string $className, string $path): bool
{
$this->components->info(
sprintf(
'%s [%s] created successfully.', $this->type, Str::after($path, $this->generatorPreset()->basePath())
'%s [%s] created successfully.', $this->type, Str::after($path, $this->generatorPreset()->basePath().DIRECTORY_SEPARATOR)
)
);

Expand Down
8 changes: 7 additions & 1 deletion src/Concerns/CreatesUsingGeneratorPreset.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ trait CreatesUsingGeneratorPreset
*/
protected function addGeneratorPresetOptions()
{
$message = 'to running the command';

if (property_exists($this, 'type') && ! empty($this->type)) {
$message = 'when generating '.Str::lower($this->type);
}

$this->getDefinition()->addOption(new InputOption(
'preset',
null,
InputOption::VALUE_OPTIONAL,
sprintf('Preset used when generating %s', Str::lower($this->type)),
sprintf('Preset used %s', $message),
null,
));
}
Expand Down

0 comments on commit 81aae88

Please sign in to comment.