not throwing ex when ignore file exists (#17501)

This commit is contained in:
William Cheng
2024-01-03 09:56:13 +08:00
committed by GitHub
parent 8b5b5a74c3
commit 218dccdb8b

View File

@@ -949,7 +949,7 @@ public class DefaultGenerator implements Generator {
LOGGER.info("Writing file " + ignoreFileNameTarget + " (which is always overwritten when the option `openapiGeneratorIgnoreFile` is enabled.)");
new File(config.outputFolder()).mkdirs();
if (!ignoreFile.createNewFile()) {
throw new RuntimeException("Failed to create the file .openapi-generator-ignore: " + ignoreFileNameTarget);
// file may already exist, do nothing
}
String header = String.join("\n",