Skip to content

Commit 55d088e

Browse files
committed
Fixinb problem where rootDir is ".", which strips all dots from the filename
1 parent 49059a1 commit 55d088e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Configurator/DockerComposeConfigurator.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,11 @@ private function getContentsAfterApplyingRecipe(string $rootDir, Recipe $recipe,
332332

333333
$updatedContents = [];
334334
foreach ($files as $file) {
335-
$localPath = ltrim(str_replace($rootDir, '', $file), '/\\');
335+
$localPath = $file;
336+
if (0 === strpos($file, $rootDir)) {
337+
$localPath = substr($file, \strlen($rootDir) + 1);
338+
}
339+
$localPath = ltrim($localPath, '/\\');
336340
$updatedContents[$localPath] = file_exists($file) ? file_get_contents($file) : null;
337341
}
338342

0 commit comments

Comments
 (0)