File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,9 @@ protected function injectNewConfigKey(string $content): bool
187187 protected function generateServerJson (string $ key , array $ serverConfig , int $ baseIndent = 0 ): string
188188 {
189189 $ json = json_encode ($ serverConfig , JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES );
190+
191+ // Normalize line endings to Unix style
192+ $ json = str_replace ("\r\n" , "\n" , $ json );
190193
191194 // If no indentation needed, return as-is
192195 if (empty ($ baseIndent )) {
@@ -379,6 +382,11 @@ protected function addServersToConfig(array &$config): void
379382 protected function writeJsonConfig (array $ config ): bool
380383 {
381384 $ json = json_encode ($ config , JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES );
385+
386+ // Normalize line endings to Unix style
387+ if ($ json ) {
388+ $ json = str_replace ("\r\n" , "\n" , $ json );
389+ }
382390
383391 return $ json && $ this ->writeFile ($ json );
384392 }
Original file line number Diff line number Diff line change 4747
4848 expect (fn () => $ writer ->write ('test guidelines ' ))
4949 ->toThrow (RuntimeException::class, 'Failed to create directory: /root/boost_test ' );
50- });
50+ })-> skipOnWindows () ;
5151
5252test ('it writes guidelines to new file ' , function () {
5353 $ tempFile = tempnam (sys_get_temp_dir (), 'boost_test_ ' );
150150
151151 expect (fn () => $ writer ->write ('test guidelines ' ))
152152 ->toThrow (RuntimeException::class, "Failed to open file: {$ dirPath }" );
153- });
153+ })-> skipOnWindows () ;
154154
155155test ('it preserves file content structure with proper spacing ' , function () {
156156 $ tempFile = tempnam (sys_get_temp_dir (), 'boost_test_ ' );
You can’t perform that action at this time.
0 commit comments