Skip to content

Commit d385b3e

Browse files
author
Adam G-H (phenaproxima)
committed
DXBE-20: Normalize Windows directory separators in config collections
1 parent 3fcb660 commit d385b3e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/Command/Source/ConfigPushCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,9 @@ private function assemblePayload(): array
150150
$relativeDir = $file->getRelativePath();
151151
// The root directory maps to the default collection ("").
152152
// Subdirectories map to dotted collection names: language/es
153-
// becomes language.es.
154-
$collection = $relativeDir === '' ? '' : str_replace('/', '.', $relativeDir);
153+
// becomes language.es. Normalize both Unix and Windows directory
154+
// separators, since Finder returns OS-specific relative paths.
155+
$collection = $relativeDir === '' ? '' : str_replace(['/', '\\'], '.', $relativeDir);
155156
$name = $file->getBasename('.yml');
156157
$payload[$collection][$name] = Yaml::parseFile($file->getPathname());
157158
}

0 commit comments

Comments
 (0)