Skip to content

Commit 1333c95

Browse files
committed
Use published stubs
1 parent 894c022 commit 1333c95

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Operations/Copy.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,11 @@ public function run(): Installable
8686

8787
protected function getStub(string $stubPath, string $basePath): string
8888
{
89-
$publishedPath = resource_path('stubs/vendor/statamic-peak-commands/'.ltrim($stubPath, " /\t\n\r\0\x0B"));
90-
$addonPath = $basePath.DIRECTORY_SEPARATOR.ltrim($stubPath, " /\t\n\r\0\x0B");
89+
$stubPath = ltrim($stubPath, " /\t\n\r\0\x0B");
90+
$addonPath = $basePath.DIRECTORY_SEPARATOR.$stubPath;
91+
92+
$stubPath = Str::of($stubPath)->replaceStart('stubs/', '')->toString();
93+
$publishedPath = resource_path('stubs/vendor/statamic-peak-commands/'.$stubPath);
9194

9295
return File::get(File::exists($publishedPath) ? $publishedPath : $addonPath);
9396
}

0 commit comments

Comments
 (0)