From 860753ec7a02d6d0e3c40fe3c61ae6785e54cca6 Mon Sep 17 00:00:00 2001 From: afroneth Date: Tue, 15 Sep 2020 13:20:37 +0800 Subject: [PATCH] Added command to add "data" folder if it does not exist --- docs/README.md | 2 +- src/main/java/Duke.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 219373ea58..e00d483838 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,7 +3,7 @@ Duke is a chat-bot application that helps you to manage your daily tasks through * [Quick Start](#quick-start) * [Features](#features) -* [Feature Details](#features) +* [Feature Details](#feature-details) diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java index 6578a289e0..43091b486e 100644 --- a/src/main/java/Duke.java +++ b/src/main/java/Duke.java @@ -1,3 +1,5 @@ +import java.io.File; + /** * Main driver class for Duke. */ @@ -22,6 +24,8 @@ public Duke(String path) { public Duke() { this.ui = new Ui(); this.storage = new Storage("data/duke.txt"); + File file = new File("data"); + file.mkdir(); try { this.arrayOfTasks = new TaskList(storage.load()); } catch (DukeException error) {