File tree Expand file tree Collapse file tree
source/compose.manager/php Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1913,11 +1913,15 @@ public static function createNew(
19131913 */
19141914 private static function writeDefaultComposeFile (string $ dir ): string
19151915 {
1916+ // Check for any existing compose file before creating a new one
1917+ $ existing = self ::getComposeFilePath ($ dir );
1918+ if ($ existing !== null ) {
1919+ return $ existing ;
1920+ }
1921+
19161922 $ filePath = "$ dir/ " . COMPOSE_FILE_NAMES [0 ];
1917- if (!file_exists ($ filePath )) {
1918- if (file_put_contents ($ filePath , "services: \n" ) === false ) {
1919- throw new \RuntimeException ("Failed to create default compose file: $ filePath " );
1920- }
1923+ if (file_put_contents ($ filePath , "services: \n" ) === false ) {
1924+ throw new \RuntimeException ("Failed to create default compose file: $ filePath " );
19211925 }
19221926 return $ filePath ;
19231927 }
You can’t perform that action at this time.
0 commit comments