Skip to content

Commit 9825c6a

Browse files
authored
Fix missing new directory during setup (#8)
1 parent 19c87c6 commit 9825c6a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

data/placeholder.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/main/java/duke/Storage.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ public class Storage {
2626
public Storage(String fileLocation) throws DukeException {
2727
try {
2828
dukeFile = new File(fileLocation);
29-
dukeFile.createNewFile();
29+
if (dukeFile.getParentFile().mkdir()) {
30+
dukeFile.createNewFile();
31+
}
3032
} catch (IOException e) {
3133
throw new StorageException(e.getMessage());
3234
}

0 commit comments

Comments
 (0)