Skip to content

Commit

Permalink
Fix missing new directory during setup (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
rssujay authored Sep 16, 2019
1 parent 19c87c6 commit 9825c6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion data/placeholder.txt

This file was deleted.

4 changes: 3 additions & 1 deletion src/main/java/duke/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public class Storage {
public Storage(String fileLocation) throws DukeException {
try {
dukeFile = new File(fileLocation);
dukeFile.createNewFile();
if (dukeFile.getParentFile().mkdir()) {
dukeFile.createNewFile();
}
} catch (IOException e) {
throw new StorageException(e.getMessage());
}
Expand Down

0 comments on commit 9825c6a

Please sign in to comment.