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 733a52d + 049388b commit 6a9927e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 12 additions & 3 deletions src/Concerns/CodeGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Orchestra\Canvas\Core\Concerns;

use Illuminate\Console\Concerns\CreatesMatchingTest;
use Illuminate\Support\Str;

trait CodeGenerator
{
Expand Down Expand Up @@ -48,7 +49,7 @@ public function generateCode(): bool
$this->handleTestCreationUsingCanvas($path);
}

return tap($this->codeHasBeenGenerated($className), function ($exitCode) use ($className, $path) {
return tap($this->codeHasBeenGenerated($className, $path), function ($exitCode) use ($className, $path) {
$this->afterCodeHasBeenGenerated($className, $path);
});
}
Expand All @@ -66,7 +67,11 @@ public function generatingCode(string $stub, string $className): string
*/
public function codeAlreadyExists(string $className, string $path): bool
{
$this->components->error(sprintf('%s [%s] already exists!', $this->type, $path));
$this->components->error(
sprintf(
'%s [%s] already exists!', $this->type, Str::after($path, $this->generatorPreset()->basePath())
)
);

return false;
}
Expand All @@ -76,7 +81,11 @@ public function codeAlreadyExists(string $className, string $path): bool
*/
public function codeHasBeenGenerated(string $className, string $path): bool
{
$this->components->info(sprintf('%s [%s] created successfully.', $this->type, $path));
$this->components->info(
sprintf(
'%s [%s] created successfully.', $this->type, Str::after($path, $this->generatorPreset()->basePath())
)
);

return true;
}
Expand Down
1 change: 0 additions & 1 deletion src/Contracts/GeneratesCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

interface GeneratesCode
{

/**
* Handle generating code.
*/
Expand Down

0 comments on commit 6a9927e

Please sign in to comment.