ongres-stringprep/fix-compilation-failure-of-ongres-stringprep-package.patch
houyingchao d6a9b1f364 Init ongres-stringprep
(cherry picked from commit 9214f49844001514768afbfd3d757ea436940982)
2022-02-14 16:29:19 +08:00

30 lines
1.3 KiB
Diff

From 398918520e2ff3e347e75cf0d335d78c3b1ba2b9 Mon Sep 17 00:00:00 2001
From: houyingchao <1348375921@qq.com>
Date: Mon, 14 Feb 2022 09:11:05 +0800
Subject: [PATCH] fix
---
.../com/ongres/stringprep/codegenerator/GeneratorCode.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/codegenerator/src/main/java/com/ongres/stringprep/codegenerator/GeneratorCode.java b/codegenerator/src/main/java/com/ongres/stringprep/codegenerator/GeneratorCode.java
index 844eccc..01cf12d 100644
--- a/codegenerator/src/main/java/com/ongres/stringprep/codegenerator/GeneratorCode.java
+++ b/codegenerator/src/main/java/com/ongres/stringprep/codegenerator/GeneratorCode.java
@@ -62,8 +62,10 @@ public class GeneratorCode {
ctx.put("parser", parser);
String path = args[0] + "/com/ongres/stringprep/StringPrep.java";
File file = new File(path);
- if (!file.getParentFile().mkdirs()) {
- throw new IOException("The directory couldn't be created");
+ if (!file.getParentFile().exists()) {
+ if (!file.getParentFile().mkdirs()) {
+ throw new IOException("The directory couldn't be created");
+ }
}
Writer writer = new OutputStreamWriter(new FileOutputStream(file),StandardCharsets.UTF_8);
template.merge(ctx, writer);
--
2.23.0