Skip to content

Commit d480ff0

Browse files
committed
Fix: resource pack dir not create
1 parent 41be88c commit d480ff0

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/main/java/i18nupdatemod/util/FileUtil.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,23 @@ public class FileUtil {
1010
private static Path temporaryDirPath;
1111

1212
public static void setResourcePackDirPath(Path path) {
13+
saveMakeDir(path);
1314
resourcePackDirPath = path;
1415
}
1516

1617
public static void setTemporaryDirPath(Path temporaryDirPath) {
18+
saveMakeDir(temporaryDirPath);
19+
FileUtil.temporaryDirPath = temporaryDirPath;
20+
}
21+
22+
private static void saveMakeDir(Path path) {
1723
try {
18-
//Make tmp dir
19-
if (!Files.isDirectory(temporaryDirPath)) {
20-
Files.createDirectories(temporaryDirPath);
24+
if (!Files.isDirectory(path)) {
25+
Files.createDirectories(path);
2126
}
2227
} catch (Exception e) {
2328
Log.warning("Cannot create dir: " + e);
2429
}
25-
FileUtil.temporaryDirPath = temporaryDirPath;
2630
}
2731

2832
public static Path getResourcePackPath(String filename) {

0 commit comments

Comments
 (0)