Skip to content

Commit

Permalink
fix lang dir not created on download
Browse files Browse the repository at this point in the history
  • Loading branch information
francescotescari committed Mar 25, 2021
1 parent c4d0f10 commit 6d04055
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/xiaomitool/v2/language/Lang.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ private static void downloadLangFile(String langCode, Path destination) throws E
if (!response.isAllRight()){
throw new Exception("Failed to download the lang file: "+response.getCode());
}
try {
Files.createDirectories(destination.getParent());
} catch (Exception e) { }
try (FileWriter writer = new FileWriter(destination.toFile())){
writer.write(response.getBody());
}
Expand Down

0 comments on commit 6d04055

Please sign in to comment.